* {
  box-sizing: border-box;
}

:root {
  --bg-0: #030406;
  --bg-1: #080b10;
  --bg-2: #0f141b;
  --glass: rgba(13, 19, 26, 0.8);
  --panel: rgba(10, 15, 20, 0.9);
  --line: #2a3541;
  --line-soft: #1f2731;
  --text: #edf3fb;
  --text-soft: #9aa8b8;
  --accent: #c7ea4f;
  --accent-2: #a5ca33;
  --ok: #7adea2;
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Sora", "Segoe UI", "Bahnschrift", sans-serif;
  background:
    linear-gradient(165deg, rgba(4, 7, 10, 0.95), rgba(5, 9, 12, 0.9)),
    url("./bg-ops.svg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

.fx {
  position: fixed;
  width: 36vw;
  height: 36vw;
  border-radius: 50%;
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

.fx-a {
  top: -12vw;
  left: -10vw;
  background: rgba(200, 234, 79, 0.13);
}

.fx-b {
  right: -12vw;
  bottom: -12vw;
  background: rgba(82, 117, 216, 0.12);
}

.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 90%);
}

.app {
  width: min(1140px, 92vw);
  margin: 1.4rem auto 2rem;
  position: relative;
  z-index: 2;
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 18, 24, 0.85), rgba(8, 13, 18, 0.88));
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  gap: 0.72rem;
  align-items: center;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(199, 234, 79, 0.17), 0 0 26px rgba(199, 234, 79, 0.45);
}

.brand-top {
  margin: 0;
  color: #99abbe;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-title {
  display: block;
  margin-top: 0.1rem;
  letter-spacing: 0.02em;
}

.brand-meta {
  margin: 0;
  color: #91a1b3;
  font-size: 0.86rem;
}

.card {
  background: linear-gradient(180deg, rgba(13, 19, 25, 0.94), rgba(8, 12, 17, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 1.2rem;
  box-shadow:
    0 36px 48px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hidden {
  display: none;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(1.45rem, 2.1vw, 2.2rem);
  letter-spacing: 0.02em;
}

h2 {
  font-size: 1.34rem;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
  color: var(--text-soft);
}

.auth h1 {
  margin-bottom: 0.5rem;
}

.auth p {
  margin-bottom: 0.8rem;
  max-width: 68ch;
}

form {
  display: grid;
  gap: 0.78rem;
}

label {
  display: grid;
  gap: 0.4rem;
  color: #c8d3df;
  font-size: 0.95rem;
}

input {
  width: 100%;
  border: 1px solid #334252;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #0e141a, #0a0f14);
  color: var(--text);
  padding: 0.76rem 0.85rem;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  border: 1px solid #334252;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #0e141a, #0a0f14);
  color: var(--text);
  padding: 0.76rem 0.85rem;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(199, 234, 79, 0.15);
  transform: translateY(-1px);
}

textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(199, 234, 79, 0.15);
  transform: translateY(-1px);
}

button {
  border: 0;
  border-radius: var(--radius-md);
  padding: 0.76rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #161c10;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  transition: transform 0.2s ease, filter 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

button.secondary {
  background: linear-gradient(180deg, #252f39, #1a232c);
  border: 1px solid #3a4756;
  color: #ecf2fa;
}

.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--line-soft);
}

.head-left {
  display: grid;
  gap: 0.45rem;
}

.eyebrow {
  font-size: 0.79rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #a7ba67;
}

.session {
  color: #c2cfdc;
}

.stats-strip {
  margin-top: 1rem;
  display: grid;
  gap: 0.74rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  border: 1px solid #314050;
  border-radius: var(--radius-lg);
  padding: 0.86rem 0.92rem;
  background: linear-gradient(180deg, rgba(11, 17, 23, 0.94), rgba(8, 13, 17, 0.96));
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: auto auto -40px -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(199, 234, 79, 0.18), transparent 68%);
}

.stat-card span {
  position: relative;
  display: block;
  color: #91a2b5;
  font-size: 0.78rem;
}

.stat-card strong {
  position: relative;
  display: block;
  margin-top: 0.25rem;
  color: #f2f7ff;
  font-size: 1.24rem;
}

.surface {
  border: 1px solid #2b3948;
  border-radius: var(--radius-lg);
  background: var(--glass);
  backdrop-filter: blur(6px);
}

.query-surface {
  margin-top: 0.95rem;
  padding: 1rem;
}

.query {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.helper {
  margin-top: 0.55rem;
  font-size: 0.86rem;
  color: #95a6b8;
}

.result {
  margin-top: 0.95rem;
  padding: 1rem;
  border: 1px solid #2d3b4a;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(8, 13, 18, 0.95), rgba(6, 10, 14, 0.96));
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.72rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(122, 222, 162, 0.45);
  background: rgba(122, 222, 162, 0.12);
  color: #a7e9c3;
  border-radius: 999px;
  padding: 0.26rem 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chip.neutral {
  border-color: rgba(164, 177, 194, 0.35);
  background: rgba(164, 177, 194, 0.12);
  color: #c7d1dd;
}

.grid {
  display: grid;
  gap: 0.64rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pwd-item {
  border: 1px solid #314152;
  border-radius: var(--radius-md);
  padding: 0.72rem 0.78rem;
  background: linear-gradient(180deg, #0c1218, #090e13);
  animation: fade-up 260ms ease both;
}

.pwd-item span {
  display: block;
  color: #9eafc1;
  font-size: 0.82rem;
}

.pwd-item strong {
  display: block;
  margin-top: 0.2rem;
  color: #f1f8cd;
  font-size: 1.56rem;
  line-height: 1;
  letter-spacing: 0.04em;
}

.password-value.masked {
  filter: blur(6px);
  user-select: none;
}

.password-value.revealed {
  filter: blur(0);
}

.discover-btn {
  margin-top: 0.58rem;
}

.control-grid {
  margin-top: 1rem;
  display: grid;
  gap: 0.88rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.users,
.audit {
  border: 1px solid #2d3b49;
  border-radius: var(--radius-lg);
  padding: 1rem;
  background: var(--panel);
}

.users .query {
  grid-template-columns: 1fr;
  gap: 0.72rem;
}

.list {
  max-height: 340px;
  overflow: auto;
  display: grid;
  gap: 0.52rem;
  padding-right: 0.2rem;
}

.list::-webkit-scrollbar {
  width: 10px;
}

.list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #2e3d4d;
}

.log-item {
  border: 1px solid #304151;
  border-radius: 10px;
  padding: 0.56rem 0.62rem;
  background: linear-gradient(180deg, #0c1217, #090e13);
  animation: fade-up 220ms ease both;
}

.log-item .time {
  font-size: 0.75rem;
  color: #92a4b8;
}

.log-item .action {
  margin-top: 0.14rem;
  color: #e8eef6;
  font-size: 0.9rem;
}

.presence-item {
  display: flex;
  align-items: center;
  gap: 0.62rem;
}

.presence-content {
  min-width: 0;
}

.presence-icon {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid #2f3c4b;
  background: linear-gradient(180deg, #0f1821, #0b1016);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.presence-icon.online::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  left: 12px;
  top: 12px;
  background: #c7ea4f;
  box-shadow: 0 0 0 5px rgba(199, 234, 79, 0.15), 0 0 16px rgba(199, 234, 79, 0.45);
}

.presence-icon.consulting::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 24px;
  right: 8px;
  top: 6px;
  border-radius: 3px;
  background: linear-gradient(180deg, #ff3f7d, #ff165d);
}

.presence-icon.consulting::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 12px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 12px solid #c7ea4f;
  filter: drop-shadow(0 0 7px rgba(199, 234, 79, 0.45));
}

.footer-note {
  margin-top: 0.9rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #2f3b48;
  background: rgba(9, 14, 18, 0.72);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-note span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 18px rgba(122, 222, 162, 0.55);
}

.footer-note p {
  margin: 0;
  font-size: 0.78rem;
  color: #9eaec0;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .control-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app {
    width: min(1140px, 94vw);
  }

  .masthead {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-head {
    align-items: stretch;
  }

  .stats-strip {
    grid-template-columns: 1fr;
  }

  .query {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }
}

/* Extensoes visuais e componentes de usuarios */
.welcome {
  color: #d8ee92;
  font-weight: 700;
}

select {
  width: 100%;
  border: 1px solid #334252;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #0e141a, #0a0f14);
  color: var(--text);
  padding: 0.76rem 0.85rem;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

select:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(199, 234, 79, 0.15);
  transform: translateY(-1px);
}

.users-list-wrap {
  margin-top: 1rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  transform: scale(1.15);
}

.section-head.compact {
  margin-bottom: 0.5rem;
}

.section-head h3 {
  margin: 0;
  font-size: 1.02rem;
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.user-main {
  min-width: 0;
}

.user-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

button.small {
  padding: 0.46rem 0.7rem;
  font-size: 0.8rem;
}

button.small.danger {
  border-color: #604153;
}

button.small.ok {
  border-color: #395341;
}

@media print {
  body * {
    visibility: hidden !important;
  }

  body::before {
    content: "Impressão bloqueada por segurança.";
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: #06090d;
    font: 700 24px/1.2 "Sora", "Segoe UI", sans-serif;
    visibility: visible !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
