/* =========================================================
   NEXUS — Central de Contingência
   ========================================================= */

:root {
  --bg: #04060c;
  --bg2: #070b16;
  --panel: rgba(9, 15, 28, .84);
  --panel-2: rgba(14, 22, 40, .72);
  --panel-solid: #0a1020;
  --field: rgba(4, 8, 18, .7);
  --line: rgba(0, 240, 255, .12);
  --line-2: rgba(150, 175, 255, .09);
  --line-3: rgba(0, 240, 255, .28);

  --text: #e6f1ff;
  --text-2: #9fb0cc;
  --text-3: #5f6f8c;

  --cyan: #00f0ff;
  --cyan-2: #00b8d4;
  --cyan-a: rgba(0, 240, 255, .14);
  --mag: #ff2bd6;
  --violet: #a78bfa;

  --ok: #2bff9a;
  --info: #38d9ff;
  --warn: #ffb547;
  --bad: #ff3d6e;
  --mute: #8592ad;
  --dead: #4b5670;

  --r: 14px;
  --r-sm: 9px;
  --cut: 10px;
  --sidebar: 248px;
  --topbar: 76px;

  --font: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(0, 240, 255, .3); color: #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--cyan); text-decoration: none; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 240, 255, .16); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 240, 255, .35); background-clip: padding-box; border: 2px solid transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(0, 240, 255, .2) transparent; }

/* ---------- Ícones ---------- */
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 22px; height: 22px; }
.ic-slot { display: inline-flex; }

/* =========================================================
   Fundo
   ========================================================= */
#bg-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.bg-grid {
  position: fixed; inset: -2px; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 240, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, .055) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 10%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 10%, transparent 75%);
  animation: gridDrift 18s linear infinite;
}
@keyframes gridDrift { to { background-position: 0 46px, 46px 0; } }
.bg-aurora {
  position: fixed; inset: -20%; z-index: 0; pointer-events: none; opacity: .55;
  background:
    radial-gradient(40% 35% at 20% 15%, rgba(0, 240, 255, .14), transparent 70%),
    radial-gradient(35% 30% at 85% 25%, rgba(255, 43, 214, .10), transparent 70%),
    radial-gradient(45% 40% at 60% 95%, rgba(124, 92, 255, .12), transparent 70%);
  filter: blur(20px);
  animation: aurora 26s ease-in-out infinite alternate;
}
@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(3%, -2%, 0) rotate(4deg); }
  100% { transform: translate3d(-3%, 3%, 0) rotate(-3deg); }
}
.scanlines { display: none; }
html.fx-scan .scanlines {
  display: block; position: fixed; inset: 0; z-index: 9000; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
html.fx-scan .scanlines::after {
  content: ''; position: absolute; left: 0; right: 0; height: 140px; top: -140px;
  background: linear-gradient(to bottom, transparent, rgba(0, 240, 255, .045), transparent);
  animation: sweep 7s linear infinite;
}
@keyframes sweep { to { transform: translateY(calc(100vh + 140px)); } }

/* =========================================================
   Cursor
   ========================================================= */
#cursor-dot, #cursor-ring { display: none; }
html.fx-cursor, html.fx-cursor * { cursor: none !important; }
html.fx-cursor #cursor-dot, html.fx-cursor #cursor-ring { display: block; }
#cursor-dot {
  position: fixed; left: 0; top: 0; z-index: 10001; pointer-events: none;
  width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan), 0 0 16px rgba(0, 240, 255, .6);
  transition: width .18s var(--ease), height .18s var(--ease), margin .18s var(--ease), border-radius .18s, background .2s, opacity .2s;
  will-change: transform;
}
#cursor-dot[data-mode="text"] { width: 2px; height: 20px; margin: -10px 0 0 -1px; border-radius: 1px; }
#cursor-dot[data-mode="lock"] { background: #fff; }
#cursor-ring {
  position: fixed; left: 0; top: 0; z-index: 10000; pointer-events: none;
  width: 34px; height: 34px;
  transition: opacity .2s;
  will-change: transform, width, height;
}
#cursor-ring i {
  position: absolute; width: 9px; height: 9px;
  border: 1.6px solid var(--cyan);
  filter: drop-shadow(0 0 4px rgba(0, 240, 255, .7));
  transition: border-color .2s, width .2s, height .2s;
}
#cursor-ring i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
#cursor-ring i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
#cursor-ring i:nth-child(3) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
#cursor-ring i:nth-child(4) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
#cursor-ring[data-mode="lock"] i { border-color: #fff; width: 11px; height: 11px; }
#cursor-ring[data-mode="hover"] i { border-color: var(--mag); filter: drop-shadow(0 0 5px rgba(255, 43, 214, .8)); }
#cursor-ring[data-mode="text"] { opacity: 0; }
#cursor-ring.down i { border-color: var(--mag); }
html.cursor-out #cursor-dot, html.cursor-out #cursor-ring { opacity: 0; }

.burst { position: fixed; z-index: 9999; pointer-events: none; width: 0; height: 0; }
.burst::before {
  content: ''; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--cyan); box-shadow: 0 0 12px var(--cyan);
  animation: burstRing .55s var(--ease-out) forwards;
}
.burst span {
  position: absolute; left: -1px; top: -1px; width: 2px; height: 8px; background: var(--cyan);
  transform-origin: 1px 1px; border-radius: 2px; box-shadow: 0 0 6px var(--cyan);
  animation: burstRay .5s var(--ease-out) forwards;
}
@keyframes burstRing { to { transform: scale(7); opacity: 0; } }
@keyframes burstRay {
  from { transform: rotate(var(--a)) translateY(4px) scaleY(.4); opacity: 1; }
  to { transform: rotate(var(--a)) translateY(26px) scaleY(1); opacity: 0; }
}

/* =========================================================
   Logo / glitch
   ========================================================= */
.logo { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 0 8px rgba(0, 240, 255, .45)); }
.logo-xl { width: 92px; height: 92px; }
.logo-spin { transform-origin: 50px 50px; animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
}
.glitch::before { color: var(--mag); transform: translate(2px, 0); clip-path: inset(0 0 0 0); opacity: .7; animation: glitchA 3.2s infinite steps(1); mix-blend-mode: screen; }
.glitch::after { color: var(--cyan); transform: translate(-2px, 0); opacity: .7; animation: glitchB 2.7s infinite steps(1); mix-blend-mode: screen; }
@keyframes glitchA {
  0%, 86%, 100% { clip-path: inset(100% 0 0 0); }
  87% { clip-path: inset(12% 0 60% 0); transform: translate(4px, -1px); }
  90% { clip-path: inset(54% 0 22% 0); transform: translate(-3px, 1px); }
  93% { clip-path: inset(80% 0 4% 0); transform: translate(3px, 0); }
}
@keyframes glitchB {
  0%, 80%, 100% { clip-path: inset(100% 0 0 0); }
  81% { clip-path: inset(30% 0 45% 0); transform: translate(-4px, 1px); }
  84% { clip-path: inset(5% 0 82% 0); transform: translate(3px, -1px); }
  88% { clip-path: inset(66% 0 10% 0); transform: translate(-2px, 0); }
}

/* =========================================================
   Botões
   ========================================================= */
.btn {
  --c: var(--cyan);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; white-space: nowrap;
  font-weight: 600; font-size: 13.5px; letter-spacing: .06em; text-transform: uppercase;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: transform .15s var(--ease), background .2s, color .2s, box-shadow .2s, filter .2s;
  overflow: hidden; isolation: isolate;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .6s var(--ease);
}
.btn:hover::after { transform: translateX(120%); }
.btn-primary { background: linear-gradient(135deg, var(--cyan), #3aa8ff); color: #01131a; }
.btn-primary:hover { filter: brightness(1.12) drop-shadow(0 0 14px rgba(0, 240, 255, .5)); }
.btn-ghost {
  background: rgba(0, 240, 255, .06); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-3);
}
.btn-ghost:hover { background: rgba(0, 240, 255, .14); color: #fff; }
.btn-danger { background: rgba(255, 61, 110, .12); color: #ff8aa6; box-shadow: inset 0 0 0 1px rgba(255, 61, 110, .4); }
.btn-danger:hover { background: rgba(255, 61, 110, .25); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; --cut: 7px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.btn-icon {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: var(--r-sm); color: var(--text-2);
  background: rgba(255, 255, 255, .02);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: color .2s, background .2s, box-shadow .2s, transform .15s;
}
.btn-icon:hover { color: var(--cyan); background: var(--cyan-a); box-shadow: inset 0 0 0 1px var(--line-3); }
.btn-icon:active { transform: scale(.92); }
.btn-icon.sm { width: 28px; height: 28px; border-radius: 7px; }
.btn-icon.sm .ic { width: 14px; height: 14px; }
.btn-icon.danger:hover { color: var(--bad); background: rgba(255, 61, 110, .12); box-shadow: inset 0 0 0 1px rgba(255, 61, 110, .4); }
.btn-icon.done { color: var(--ok) !important; box-shadow: inset 0 0 0 1px rgba(43, 255, 154, .5) !important; }

kbd {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-2);
  padding: 2px 6px; border-radius: 5px; background: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 0 rgba(0, 0, 0, .4);
}

/* =========================================================
   Tela de bloqueio
   ========================================================= */
.lock {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px 16px;
  overflow-y: auto;
  transition: opacity .7s var(--ease), transform .8s var(--ease), filter .7s;
}
.lock.out { opacity: 0; transform: scale(1.08); filter: blur(10px); pointer-events: none; }
.lock-box {
  position: relative; width: min(440px, 100%);
  padding: 34px 32px 22px;
  background: linear-gradient(180deg, rgba(10, 18, 34, .78), rgba(5, 9, 18, .82));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
  box-shadow: inset 0 0 0 1px var(--line);
  animation: boxIn .9s var(--ease-out) both;
}
.lock-box::before, .lock-box::after {
  content: ''; position: absolute; width: 60px; height: 60px; pointer-events: none;
  border: 2px solid var(--cyan); filter: drop-shadow(0 0 6px var(--cyan));
}
.lock-box::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.lock-box::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
@keyframes boxIn { from { opacity: 0; transform: translateY(20px) scale(.97); } }
.lock.denied .lock-box { animation: shake .5s; }
.lock.denied .lock-box::before, .lock.denied .lock-box::after { border-color: var(--bad); filter: drop-shadow(0 0 8px var(--bad)); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); }
}
.lock-brand { text-align: center; }
.lock-brand h1 {
  margin: 14px 0 2px; font-size: 44px; font-weight: 700; letter-spacing: .32em; text-indent: .32em;
  background: linear-gradient(90deg, #fff, #a9f6ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lock-brand h1::before, .lock-brand h1::after { -webkit-text-fill-color: currentColor; }
.lock-sub { margin: 0; color: var(--text-2); font-size: 13px; letter-spacing: .18em; text-transform: uppercase; }

.boot {
  margin: 22px 0 18px; padding: 12px 14px; min-height: 104px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.75; color: var(--text-2);
  background: rgba(0, 0, 0, .35); border-left: 2px solid var(--cyan);
}
.boot .ok { color: var(--ok); }
.boot .warn { color: var(--warn); }
.boot .hl { color: var(--cyan); }
.boot .caret { display: inline-block; width: 7px; height: 13px; vertical-align: -2px; background: var(--cyan); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.lock-form { display: grid; gap: 14px; }
.lock-title { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--cyan); }
.lock-field { position: relative; display: grid; gap: 6px; }
.lock-field span { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.lock-field input {
  height: 46px; padding: 0 14px; border: 0; outline: 0;
  font-family: var(--mono); font-size: 16px; letter-spacing: .2em;
  background: rgba(0, 0, 0, .45); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow .2s;
}
.lock-field input:focus { box-shadow: inset 0 0 0 1px var(--line-3), 0 0 24px rgba(0, 240, 255, .12); }
.lock-line { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: linear-gradient(90deg, var(--cyan), var(--mag)); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
.lock-field input:focus ~ .lock-line { transform: scaleX(1); }
.lock-meter { height: 4px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.lock-meter i { display: block; height: 100%; width: 0; transition: width .3s var(--ease), background .3s; }
.lock-msg { margin: 0; min-height: 20px; font-family: var(--mono); font-size: 12px; color: var(--text-2); text-align: center; }
.lock-msg.bad { color: var(--bad); }
.lock-msg.ok { color: var(--ok); }
.lock-reset { justify-self: center; font-size: 12px; color: var(--text-3); text-decoration: underline; text-underline-offset: 3px; }
.lock-reset:hover { color: var(--bad); }
.lock-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; padding-top: 14px; border-top: 1px dashed var(--line); font-family: var(--mono); font-size: 10.5px; color: var(--text-3); letter-spacing: .08em; }
.lock-foot span { display: inline-flex; align-items: center; gap: 6px; }
.btn.loading { pointer-events: none; }
.btn.loading::before {
  content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 40%;
  background: #01131a; animation: loadbar 1s var(--ease) infinite;
}
@keyframes loadbar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.lock.granted .lock-box::before, .lock.granted .lock-box::after { border-color: var(--ok); filter: drop-shadow(0 0 10px var(--ok)); }

.led { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: pulse 2s ease-in-out infinite; flex: none; }
@keyframes pulse { 50% { opacity: .35; } }

/* =========================================================
   Layout do app
   ========================================================= */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100vh; height: 100dvh; }
.app.enter .sidebar { animation: slideR .8s var(--ease-out) both; }
.app.enter .topbar { animation: slideD .8s .1s var(--ease-out) both; }
@keyframes slideR { from { opacity: 0; transform: translateX(-30px); } }
@keyframes slideD { from { opacity: 0; transform: translateY(-20px); } }

.sidebar {
  position: relative; display: flex; flex-direction: column; gap: 18px; min-height: 0;
  padding: 20px 14px 16px;
  background: linear-gradient(180deg, rgba(6, 11, 22, .82), rgba(4, 7, 14, .9));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--line);
}
.sidebar::after {
  content: ''; position: absolute; right: -1px; top: 18%; width: 1px; height: 120px;
  background: linear-gradient(transparent, var(--cyan), transparent);
  animation: railScan 6s ease-in-out infinite;
}
@keyframes railScan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(380px); } }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 6px; }
.brand-text strong { display: block; font-size: 21px; letter-spacing: .3em; line-height: 1.1; }
.brand-text small { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }

.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; min-height: 0; }
.nav-sep { margin: 12px 10px 4px; font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  height: 42px; padding: 0 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 500; font-size: 14.5px; letter-spacing: .02em; text-align: left;
  transition: color .2s, background .2s;
}
.nav-item .lbl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .035); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(0, 240, 255, .16), rgba(0, 240, 255, .02));
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, .18);
}
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--cyan); box-shadow: 0 0 12px var(--cyan);
}
.nav-item.active .ic { color: var(--cyan); filter: drop-shadow(0 0 5px rgba(0, 240, 255, .7)); }
.nav-count { font-family: var(--mono); font-size: 11px; color: var(--text-3); padding: 1px 7px; border-radius: 20px; background: rgba(255, 255, 255, .04); }
.nav-item.active .nav-count { color: var(--cyan); background: rgba(0, 240, 255, .1); }
.nav-count.has-alert { color: var(--warn); background: rgba(255, 181, 71, .12); }

.side-foot { margin-top: auto; display: grid; gap: 12px; }
.sys { padding: 12px; border-radius: 10px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--line-2); display: grid; gap: 6px; }
.sys-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.sys-row.mono { font-size: 10.5px; color: var(--text-3); letter-spacing: .04em; }

.main { position: relative; min-width: 0; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  height: var(--topbar); padding: 0 28px;
  background: linear-gradient(180deg, rgba(4, 6, 12, .92), rgba(4, 6, 12, .7));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.tb-title { min-width: 0; }
.crumb { font-size: 10.5px; letter-spacing: .18em; color: var(--text-3); text-transform: uppercase; }
.crumb span { color: var(--cyan); margin: 0 4px; }
.crumb em { font-style: normal; color: var(--text-2); }
.tb-title h2 { margin: 0; font-size: 23px; font-weight: 600; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-search {
  flex: 1; max-width: 460px; margin-left: auto; display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 10px 0 14px; border-radius: 10px;
  color: var(--text-3); font-size: 13.5px;
  background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow .2s, background .2s;
}
.tb-search:hover { box-shadow: inset 0 0 0 1px var(--line-3); background: rgba(0, 240, 255, .05); color: var(--text-2); }
.tb-search-text { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-right { display: flex; align-items: center; gap: 10px; }
.tb-meta { display: grid; gap: 1px; text-align: right; font-size: 10.5px; letter-spacing: .1em; color: var(--text-3); white-space: nowrap; }
.save-state { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; color: var(--ok); }
.save-state i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.save-state.saving { color: var(--warn); }
.save-state.saving i { animation: pulse .5s infinite; }
.save-state.error { color: var(--bad); }

.view { padding: 26px 28px 60px; max-width: 1560px; }
.view.enter > * { animation: fadeUp .7s var(--ease-out) both; }
.view.enter > *:nth-child(2) { animation-delay: .06s; }
.view.enter > *:nth-child(3) { animation-delay: .12s; }
.view.enter > *:nth-child(4) { animation-delay: .18s; }
.view.enter > *:nth-child(5) { animation-delay: .24s; }
.view.enter > *:nth-child(n+6) { animation-delay: .3s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } }
.stagger > * { animation: fadeUp .6s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms); }

/* =========================================================
   Painéis / cards
   ========================================================= */
.panel {
  position: relative; padding: 20px;
  background: var(--panel);
  border-radius: var(--r);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 20px 40px -24px rgba(0, 0, 0, .8);
}
.panel.hud::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(0, 240, 255, .45), transparent 28%, transparent 72%, rgba(255, 43, 214, .35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.spot { overflow: hidden; }
.spot::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 240, 255, .09), transparent 45%);
  transition: opacity .3s;
}
.spot:hover::after { opacity: 1; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.panel-head h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--text-2); }
.panel-head h3::before { content: '// '; color: var(--cyan); }
.panel-head .sp { flex: 1; }
.panel-head .muted { font-family: var(--mono); font-size: 11px; }

.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.mt { margin-top: 18px; }

/* ---------- Hero ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.hero h1 { margin: 0; font-size: 32px; font-weight: 600; letter-spacing: .02em; line-height: 1.15; }
.hero h1 b { color: var(--cyan); font-weight: 600; text-shadow: 0 0 18px rgba(0, 240, 255, .5); }
.hero p { margin: 6px 0 0; color: var(--text-2); font-family: var(--mono); font-size: 12px; letter-spacing: .06em; }
.hero-clock { text-align: right; font-family: var(--mono); }
.hero-clock strong { display: block; font-size: 30px; font-weight: 500; letter-spacing: .08em; color: var(--text); text-shadow: 0 0 14px rgba(0, 240, 255, .35); }
.hero-clock span { font-size: 11px; color: var(--text-3); letter-spacing: .14em; text-transform: uppercase; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  position: relative; padding: 16px 16px 14px; border-radius: var(--r);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transform-style: preserve-3d; transition: transform .25s var(--ease), box-shadow .25s;
}
.kpi:hover { box-shadow: inset 0 0 0 1px var(--line-3), 0 12px 30px -12px rgba(0, 240, 255, .25); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-3); }
.kpi-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.kpi-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(0, 240, 255, .08); color: var(--cyan); }
.kpi-icon.bad { background: rgba(255, 61, 110, .1); color: var(--bad); }
.kpi-icon.ok { background: rgba(43, 255, 154, .08); color: var(--ok); }
.kpi-icon.warn { background: rgba(255, 181, 71, .1); color: var(--warn); }
.kpi-icon.violet { background: rgba(167, 139, 250, .1); color: var(--violet); }
.kpi-value { margin-top: 10px; font-family: var(--mono); font-size: 30px; font-weight: 500; letter-spacing: -.02em; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value small { font-size: 15px; color: var(--text-3); font-weight: 400; }
.kpi-sub { margin-top: 6px; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-bar { margin-top: 10px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.kpi-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--cyan), var(--mag)); transition: width 1.2s var(--ease-out); }

/* ---------- Gráficos ---------- */
.seg { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, .04); }
.seg i { display: block; height: 100%; min-width: 3px; flex: 0 0 0; transition: flex-grow 1.1s var(--ease-out); }
.seg i:first-child { border-radius: 4px 0 0 4px; }
.seg i:last-child { border-radius: 0 4px 4px 0; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 6px 14px; margin-top: 16px; }
.legend-item .lg-l { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-item { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); padding: 6px 8px; border-radius: 8px; transition: background .2s; }
.legend-item:hover { background: rgba(255, 255, 255, .04); }
.legend-item .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-item b { margin-left: auto; font-family: var(--mono); font-weight: 500; color: var(--text); }
.legend-item em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--text-3); width: 36px; text-align: right; }

.bars { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 10px; height: 170px; padding-top: 20px; border-bottom: 1px solid var(--line-2); }
.bars::before, .bars::after { content: ''; position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(255, 255, 255, .05); pointer-events: none; }
.bars::before { top: 20px; }
.bars::after { top: calc(20px + (100% - 20px) / 2); }
.bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar i {
  display: block; width: min(34px, 70%); height: 0; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--bad), rgba(255, 61, 110, .35));
  box-shadow: 0 0 16px rgba(255, 61, 110, .25);
  transition: height 1s var(--ease-out), filter .2s;
}
.bar:hover i { filter: brightness(1.3); }
.bar b { position: absolute; bottom: 0; margin-bottom: 5px; font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--text); transition: bottom 1s var(--ease-out); }
.bar.zero i { height: 2px !important; background: rgba(255, 255, 255, .1); box-shadow: none; }
.bars-x { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin-top: 8px; }
.bars-x span { text-align: center; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }

.tip {
  position: fixed; z-index: 9500; pointer-events: none; padding: 7px 10px; border-radius: 8px;
  font-family: var(--mono); font-size: 11.5px; color: var(--text); white-space: nowrap;
  background: rgba(5, 10, 20, .95); box-shadow: inset 0 0 0 1px var(--line-3), 0 10px 30px rgba(0, 0, 0, .5);
  transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .15s;
}
.tip.show { opacity: 1; }

/* ---------- Alertas ---------- */
.alerts { display: grid; gap: 8px; max-height: 330px; overflow-y: auto; padding-right: 4px; }
.alert {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .025); box-shadow: inset 3px 0 0 var(--c, var(--warn)), inset 0 0 0 1px var(--line-2);
  transition: background .2s, transform .2s;
}
.alert:hover { background: rgba(255, 255, 255, .05); transform: translateX(3px); }
.alert .ic { color: var(--c, var(--warn)); }
.alert-txt { flex: 1; min-width: 0; font-size: 13.5px; }
.alert-txt small { display: block; color: var(--text-3); font-size: 11.5px; font-family: var(--mono); }
.all-clear { display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: 10px; color: var(--ok); background: rgba(43, 255, 154, .05); box-shadow: inset 0 0 0 1px rgba(43, 255, 154, .2); font-size: 14px; }

/* ---------- Feed ---------- */
.feed { display: grid; gap: 2px; max-height: 330px; overflow-y: auto; }
.feed-item { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 8px 6px; border-radius: 8px; font-size: 13.5px; }
.feed-item:hover { background: rgba(255, 255, 255, .03); }
.feed-item .ic { margin-top: 1px; color: var(--text-3); }
.feed-item time { font-family: var(--mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }
.feed-item .who { color: var(--cyan); }

/* =========================================================
   Barra de ferramentas / filtros
   ========================================================= */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.search {
  position: relative; display: flex; align-items: center; flex: 1; min-width: 220px; max-width: 420px;
}
.search .ic { position: absolute; left: 13px; color: var(--text-3); pointer-events: none; }
.search input { padding-left: 40px !important; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 30px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: color .2s, background .2s, box-shadow .2s;
}
.chip:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.chip.on { color: #fff; background: rgba(0, 240, 255, .12); box-shadow: inset 0 0 0 1px rgba(0, 240, 255, .45); }
.chip .n { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.chip.on .n { color: var(--cyan); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); }
.tb-spacer { flex: 1; }
.select-sm { height: 36px !important; width: auto !important; min-width: 160px; font-size: 13px !important; }

/* =========================================================
   Status
   ========================================================= */
.st-ok { --c: var(--ok); } .st-info { --c: var(--info); } .st-warn { --c: var(--warn); }
.st-bad { --c: var(--bad); } .st-mute { --c: var(--mute); } .st-violet { --c: var(--violet); } .st-dead { --c: var(--dead); }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 20px; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--c); background: color-mix(in srgb, var(--c) 11%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent);
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.pill.st-ok::before, .pill.st-warn::before { animation: pulse 1.6s ease-in-out infinite; }
button.pill { transition: filter .2s; }
button.pill:hover { filter: brightness(1.25); }
button.pill .ic { width: 12px; height: 12px; margin-right: -3px; }

/* =========================================================
   Cards de contas
   ========================================================= */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 18px; border-radius: var(--r);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow .25s, transform .25s var(--ease);
}
.card::before {
  content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 2px; border-radius: 2px;
  background: var(--c, var(--line)); box-shadow: 0 0 10px var(--c, transparent); opacity: .8;
}
.card:hover { box-shadow: inset 0 0 0 1px var(--line-3), 0 18px 40px -18px rgba(0, 240, 255, .28); transform: translateY(-2px); }
.card-head { display: flex; align-items: flex-start; gap: 12px; }
.hex {
  display: grid; place-items: center; width: 44px; height: 48px; flex: none;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(135deg, color-mix(in srgb, var(--c, var(--cyan)) 35%, transparent), rgba(0, 0, 0, .3));
  color: var(--c, var(--cyan)); font-family: var(--mono); font-weight: 700; font-size: 13px;
}
.card-title { flex: 1; min-width: 0; }
.card-title h4 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title .sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.cred { display: grid; gap: 6px; padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px var(--line-2); }
.cred-row { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.cred-row > .ic { color: var(--text-3); }
.cred-val { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cred-val.secret { letter-spacing: .12em; }
.cred-val.empty { color: var(--text-3); font-style: italic; letter-spacing: 0; }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.tagd {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 26px; padding: 0 9px; border-radius: 7px;
  font-family: var(--mono); font-size: 12px; color: var(--text);
  background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background .2s, box-shadow .2s;
}
.tagd span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.tagd:hover, a.tagd:hover { background: rgba(0, 240, 255, .1); box-shadow: inset 0 0 0 1px var(--line-3); }
.tagd .d { width: 6px; height: 6px; border-radius: 50%; background: var(--c); flex: none; }
.tag { font-family: var(--mono); font-size: 11px; color: var(--violet); }
.card-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: 12px; color: var(--text-3); }
.card-foot .tags { flex: 1; display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.card-foot .stat { font-family: var(--mono); white-space: nowrap; }
.card-foot .stat b { color: var(--text-2); font-weight: 500; }
.none { font-size: 12.5px; color: var(--text-3); font-style: italic; }

/* =========================================================
   Tabelas
   ========================================================= */
.table-wrap { overflow-x: auto; border-radius: var(--r); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-2); }
table.t { width: 100%; border-collapse: collapse; min-width: 900px; }
.t th {
  position: sticky; top: 0; padding: 13px 14px; text-align: left; white-space: nowrap;
  font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
  background: rgba(6, 10, 20, .9); border-bottom: 1px solid var(--line);
}
.t td { padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, .04); vertical-align: middle; font-size: 13.5px; }
.t tbody tr { position: relative; transition: background .15s; }
.t tbody tr:hover { background: linear-gradient(90deg, rgba(0, 240, 255, .07), rgba(0, 240, 255, .01)); }
.t tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--cyan); }
.t tbody tr:last-child td { border-bottom: 0; }
.t .strong { font-weight: 600; font-size: 14.5px; }
.t .mono { font-size: 12.5px; }
.t .num { text-align: right; font-family: var(--mono); }
.t .acts { display: flex; gap: 6px; justify-content: flex-end; }
.t .cell-login { display: flex; align-items: center; gap: 6px; }
.t .cell-login .mono { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.exp { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.exp.warn { color: var(--warn); }
.exp.bad { color: var(--bad); }
.linkbtn { color: var(--text); text-align: left; transition: color .2s; }
.linkbtn:hover { color: var(--cyan); }

/* =========================================================
   Vazio
   ========================================================= */
.empty {
  display: grid; justify-items: center; gap: 14px; padding: 60px 20px; text-align: center;
  border-radius: var(--r); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-2);
}
.empty-icon { display: grid; place-items: center; width: 74px; height: 80px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: linear-gradient(135deg, rgba(0, 240, 255, .25), rgba(255, 43, 214, .12)); color: var(--cyan); }
.empty-icon .ic { width: 30px; height: 30px; }
.empty h3 { margin: 0; font-size: 20px; font-weight: 600; }
.empty p { margin: 0; max-width: 460px; color: var(--text-2); font-size: 14px; }
.empty .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

.welcome { padding: 44px 32px; display: grid; gap: 26px; }
.welcome h1 { margin: 0; font-size: 34px; font-weight: 600; line-height: 1.15; }
.welcome h1 b { color: var(--cyan); text-shadow: 0 0 18px rgba(0, 240, 255, .4); font-weight: 600; }
.welcome > p { margin: 0; max-width: 640px; color: var(--text-2); font-size: 15px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.step { padding: 18px; border-radius: 12px; background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px var(--line-2); }
.step b { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--cyan); margin-bottom: 8px; }
.step h4 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.step p { margin: 0; font-size: 13px; color: var(--text-2); }

/* =========================================================
   Formulários
   ========================================================= */
.field { display: grid; gap: 6px; min-width: 0; }
.field.w2 { grid-column: 1 / -1; }
.field > label, .field > .flabel { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.field > label .req { color: var(--mag); }
.input, input.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 13px; border: 0; outline: 0; border-radius: 9px;
  background: var(--field); color: var(--text); font-size: 14px;
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow .2s, background .2s;
}
textarea.input { height: auto; min-height: 84px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.input.mono { font-family: var(--mono); font-size: 13px; }
.input:hover { box-shadow: inset 0 0 0 1px rgba(150, 175, 255, .2); }
.input:focus { box-shadow: inset 0 0 0 1px var(--cyan), 0 0 0 3px rgba(0, 240, 255, .12); background: rgba(0, 10, 22, .85); }
.input::placeholder { color: #3f4c66; }
.input.invalid { box-shadow: inset 0 0 0 1px var(--bad), 0 0 0 3px rgba(255, 61, 110, .14); }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300f0ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 15px;
}
select.input option { background: #0a1020; color: var(--text); }
input[type="date"].input { color-scheme: dark; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 84px; }
.input-group .ig-btns { position: absolute; right: 6px; display: flex; gap: 4px; }
.hint { font-size: 11.5px; color: var(--text-3); }
.hint.bad { color: var(--bad); }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-sec {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--cyan);
}
.form-sec::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-3), transparent); }
.form-sec:first-child { margin-top: 0; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; max-height: 190px; overflow-y: auto; padding: 10px; border-radius: 10px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line-2); }
.pick label {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 11px; border-radius: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
  background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: all .2s; user-select: none;
}
.pick label:hover { color: var(--text); }
.pick input { display: none; }
.pick label:has(input:checked) { color: #fff; background: rgba(0, 240, 255, .14); box-shadow: inset 0 0 0 1px rgba(0, 240, 255, .5); }
.pick label small { color: var(--text-3); font-size: 10.5px; }
.pick label .box { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px var(--text-3); display: grid; place-items: center; }
.pick label:has(input:checked) .box { background: var(--cyan); box-shadow: none; }
.pick label:has(input:checked) .box::after { content: ''; width: 7px; height: 4px; border-left: 2px solid #01131a; border-bottom: 2px solid #01131a; transform: rotate(-45deg) translate(1px, -1px); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line-2); }
.switch:last-child { border-bottom: 0; }
.switch-txt { flex: 1; min-width: 0; }
.switch > .btn { flex: none; }
.switch-txt b { display: block; font-weight: 600; font-size: 14px; }
.switch-txt small { color: var(--text-3); font-size: 12.5px; }
.toggle { position: relative; width: 46px; height: 24px; flex: none; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.toggle i { position: absolute; inset: 0; border-radius: 20px; background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px var(--line-2); transition: background .25s; pointer-events: none; }
.toggle i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-3); transition: transform .3s var(--ease), background .25s, box-shadow .25s; }
.toggle input:checked + i { background: rgba(0, 240, 255, .2); box-shadow: inset 0 0 0 1px rgba(0, 240, 255, .5); }
.toggle input:checked + i::after { transform: translateX(22px); background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }

/* =========================================================
   Drawer
   ========================================================= */
.drawer-wrap { position: fixed; inset: 0; z-index: 100; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(1, 3, 8, .6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .3s both; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(680px, 100%);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(8, 13, 26, .97), rgba(4, 7, 14, .98));
  box-shadow: -1px 0 0 var(--line), -40px 0 80px rgba(0, 0, 0, .6);
  animation: drawerIn .45s var(--ease-out) both;
}
.drawer::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: linear-gradient(transparent, var(--cyan), var(--mag), transparent); opacity: .7; }
@keyframes drawerIn { from { transform: translateX(60px); opacity: 0; } }
.drawer-wrap.closing .drawer { animation: drawerOut .25s var(--ease) forwards; }
.drawer-wrap.closing .drawer-backdrop { animation: fade .25s reverse forwards; }
@keyframes drawerOut { to { transform: translateX(60px); opacity: 0; } }
.dr-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line-2); }
.dr-head .hex { width: 52px; height: 58px; font-size: 15px; }
.dr-title { flex: 1; min-width: 0; }
.dr-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); }
.dr-title h3 { margin: 2px 0 6px; font-size: 24px; font-weight: 600; line-height: 1.15; word-break: break-word; }
.dr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.dr-body { flex: 1; overflow-y: auto; padding: 20px 24px 28px; display: grid; gap: 18px; align-content: start; }
.dr-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--line-2); background: rgba(0, 0, 0, .25); }
.dr-foot .sp { flex: 1; }
.dr-sec { display: grid; gap: 10px; }
.dr-sec > h5 { margin: 0; display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); }
.dr-sec > h5::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.dr-sec > h5 .n { color: var(--cyan); }
.kv { display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px var(--line-2); }
.kv + .kv { margin-top: -4px; }
.kv-k { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.kv-v { min-width: 0; font-family: var(--mono); font-size: 13.5px; overflow-wrap: anywhere; }
.kv-v.secret { letter-spacing: .14em; }
.kv-v pre { margin: 0; white-space: pre-wrap; font: inherit; }
.kv-a { display: flex; gap: 4px; }
.kv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini { padding: 10px 12px; border-radius: 9px; background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px var(--line-2); min-width: 0; }
.mini span { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.mini b { display: block; margin-top: 3px; font-family: var(--mono); font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 12px; border-radius: 10px; background: rgba(255, 255, 255, .025); box-shadow: inset 0 0 0 1px var(--line-2); transition: background .2s, box-shadow .2s; }
.rel:hover { background: rgba(0, 240, 255, .06); box-shadow: inset 0 0 0 1px var(--line-3); }
.rel .ic { color: var(--c, var(--text-3)); }
.rel-main { flex: 1; min-width: 0; }
.rel-main b { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-main small { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-card { padding: 14px; border-radius: 12px; background: linear-gradient(135deg, rgba(0, 240, 255, .07), rgba(255, 43, 214, .03)); box-shadow: inset 0 0 0 1px var(--line-3); display: grid; gap: 10px; }
.rel-card-head { display: flex; align-items: center; gap: 10px; }
.rel-card-head .hex { width: 34px; height: 38px; font-size: 11px; }
.rel-card-head b { flex: 1; font-size: 16px; font-weight: 600; }
.notes { margin: 0; padding: 12px 14px; border-radius: 10px; white-space: pre-wrap; font-size: 14px; color: var(--text-2); background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px var(--line-2); }

.timeline { position: relative; display: grid; gap: 4px; padding-left: 18px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(var(--line-3), transparent); }
.tl-item { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 13.5px; }
.tl-item::before { content: ''; position: absolute; left: -17px; top: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 2px var(--c, var(--text-3)); }
.tl-item.note::before { background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.tl-item:hover { background: rgba(255, 255, 255, .03); }
.tl-item time { font-family: var(--mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }
.tl-item .tl-del { opacity: 0; transition: opacity .2s; }
.tl-item:hover .tl-del { opacity: 1; }
.tl-add { display: flex; gap: 8px; }

/* =========================================================
   Modal / menu / paleta / toasts
   ========================================================= */
.modal-wrap { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; background: rgba(1, 3, 8, .66); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .2s both; }
.modal {
  position: relative; width: min(480px, 100%); padding: 24px;
  background: linear-gradient(180deg, rgba(10, 17, 32, .98), rgba(5, 9, 18, .98));
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  box-shadow: inset 0 0 0 1px var(--line-3);
  animation: boxIn .35s var(--ease-out) both;
}
.modal.danger { box-shadow: inset 0 0 0 1px rgba(255, 61, 110, .5); }
.modal h3 { margin: 0 0 8px; display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; }
.modal.danger h3 .ic { color: var(--bad); }
.modal p { margin: 0 0 16px; color: var(--text-2); font-size: 14px; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal.wide { width: min(760px, 100%); }

.menu {
  position: fixed; z-index: 400; min-width: 200px; padding: 6px; border-radius: 12px;
  background: rgba(7, 12, 24, .98); box-shadow: inset 0 0 0 1px var(--line-3), 0 20px 50px rgba(0, 0, 0, .6);
  animation: menuIn .18s var(--ease-out) both;
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border-radius: 8px; text-align: left; font-size: 13.5px; color: var(--text-2); }
.menu button:hover { background: rgba(0, 240, 255, .1); color: #fff; }
.menu button .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); }
.menu button.cur { color: #fff; }
.menu button.cur::after { content: '●'; margin-left: auto; font-size: 8px; color: var(--cyan); }
.menu kbd { margin-left: auto; }

.palette-wrap { position: fixed; inset: 0; z-index: 350; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(1, 3, 8, .6); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: fade .2s both; }
.palette {
  width: min(680px, 100%); max-height: 70vh; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 16px; background: rgba(7, 12, 24, .98);
  box-shadow: inset 0 0 0 1px var(--line-3), 0 40px 100px rgba(0, 0, 0, .7), 0 0 60px rgba(0, 240, 255, .08);
  animation: boxIn .3s var(--ease-out) both;
}
.pal-in { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line-2); }
.pal-in .ic { color: var(--cyan); }
.pal-in input { flex: 1; height: 58px; border: 0; outline: 0; background: none; font-size: 17px; }
.pal-list { overflow-y: auto; padding: 8px; }
.pal-group { padding: 10px 10px 4px; font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); }
.pal-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 10px; text-align: left; }
.pal-item.sel { background: rgba(0, 240, 255, .1); box-shadow: inset 0 0 0 1px rgba(0, 240, 255, .3); }
.pal-item > .ic { color: var(--c, var(--text-3)); }
.pal-item .pm { flex: 1; min-width: 0; }
.pal-item .pm b { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item .pm small { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item mark { background: none; color: var(--cyan); }
.pal-item .pa { display: flex; gap: 4px; }
.pal-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line-2); font-size: 11.5px; color: var(--text-3); }
.pal-foot span { display: inline-flex; align-items: center; gap: 6px; }
.pal-empty { padding: 30px; text-align: center; color: var(--text-3); font-size: 14px; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 500; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 380px;
  padding: 11px 16px 11px 13px; border-radius: 10px; font-size: 13.5px;
  background: rgba(7, 12, 24, .97); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent), 0 14px 40px rgba(0, 0, 0, .55), 0 0 22px color-mix(in srgb, var(--c) 14%, transparent);
  animation: toastIn .4s var(--ease-out) both;
  position: relative; overflow: hidden;
}
.toast .ic { color: var(--c); }
.toast::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--c); transform-origin: left; animation: toastBar var(--d, 3s) linear forwards; opacity: .7; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
@keyframes toastBar { to { transform: scaleX(0); } }

/* =========================================================
   Mapa
   ========================================================= */
.map-wrap { position: relative; height: calc(100vh - var(--topbar) - 120px); min-height: 460px; border-radius: var(--r); overflow: hidden; background: radial-gradient(ellipse at center, rgba(0, 240, 255, .05), rgba(4, 7, 14, .6) 70%); box-shadow: inset 0 0 0 1px var(--line-2); }
.map-wrap canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.map-ui { position: absolute; left: 14px; top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.map-legend { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 14px; flex-wrap: wrap; padding: 9px 13px; border-radius: 10px; background: rgba(4, 8, 16, .82); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 12px; color: var(--text-2); }
.map-legend span { display: inline-flex; align-items: center; gap: 7px; }
.map-legend svg { width: 14px; height: 14px; }
.map-help { position: absolute; right: 14px; top: 16px; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); letter-spacing: .06em; text-align: right; pointer-events: none; }
@media (max-width: 1000px) { .map-help { display: none; } }

/* =========================================================
   Configurações
   ========================================================= */
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.set-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.set-info { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin: 10px 0 0; }
.danger-zone { box-shadow: inset 0 0 0 1px rgba(255, 61, 110, .3) !important; }
.danger-zone .panel-head h3::before { color: var(--bad); }
.import-box { display: grid; gap: 12px; }
.import-preview { font-family: var(--mono); font-size: 12px; color: var(--text-2); padding: 10px 12px; border-radius: 9px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--line-2); }
.shortcuts { display: grid; gap: 8px; }
.shortcuts div { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; color: var(--text-2); }

/* ---------- Complementos ---------- */
.table-wrap.flat { background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 0; }
.table-wrap.flat .t th { background: transparent; position: static; }
.t.compact { min-width: 0; }
.t.compact th, .t.compact td { padding: 10px 8px; }
.t.compact .strong { white-space: nowrap; }
.t.compact .cell-login .mono { max-width: 170px; }
.st-text { display: inline-block; margin-top: 2px; color: var(--c); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.tl-add .input { flex: 1; }
.tl-add .btn { height: 42px; }
.hex .ic { width: 20px; height: 20px; }
.hex .ic-sm { width: 15px; height: 15px; }
.dr-head .hex .ic-lg { width: 24px; height: 24px; }
.feed-item > div .ic { display: inline; vertical-align: -3px; margin-right: 2px; width: 14px; height: 14px; color: var(--text-3); }
.linkbtn.who { color: var(--cyan); font-weight: 600; }
.linkbtn.who:hover { text-decoration: underline; text-underline-offset: 3px; }
.dr-body { animation: fade .35s var(--ease) both; }

/* =========================================================
   Responsivo
   ========================================================= */
@media (max-width: 1640px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  :root { --sidebar: 78px; }
  .brand-text, .nav-item .lbl, .nav-count, .nav-sep, .sys, .side-foot .lbl { display: none; }
  .brand { justify-content: center; padding: 0 0 6px; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item.active::before { left: -14px; }
  .g-3-2, .g-2, .settings { grid-template-columns: 1fr; }
  .tb-meta { display: none; }
}
@media (max-width: 860px) {
  body { overflow: auto; }
  .app { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 60; height: 64px;
    flex-direction: row; padding: 8px 10px; border-right: 0; border-top: 1px solid var(--line);
  }
  .sidebar::after, .brand, .side-foot { display: none; }
  .nav { flex-direction: row; justify-content: space-around; width: 100%; overflow-x: auto; overflow-y: hidden; }
  .nav-item { width: 44px; flex: none; }
  .nav-item.active::before { left: 10px; right: 10px; top: auto; bottom: -8px; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .main { overflow: visible; padding-bottom: 70px; }
  .topbar { padding: 0 16px; gap: 10px; }
  .tb-search { max-width: none; }
  .tb-search-text, .tb-search kbd, #btn-new .lbl { display: none; }
  .tb-search { flex: 0 0 40px; padding: 0; justify-content: center; margin-left: auto; }
  .view { padding: 18px 16px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px 12px 12px; }
  .kpi-value { font-size: 22px; }
  .kpi-value small { font-size: 12px; }
  .nav-item { width: 40px; }
  .cards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr auto; }
  .kv-k { grid-column: 1 / -1; }
  .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-clock { display: none; }
  .toasts { left: 16px; right: 16px; bottom: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
