:root {
  color-scheme: dark;
  --bg: #09070f;
  --panel: #14101f;
  --panel-2: #1a1328;
  --text: #f5f3ff;
  --muted: #a7a1b8;
  --line: rgba(196, 181, 253, 0.16);
  --brand: #8b5cf6;
  --brand-2: #c084fc;
  --accent: #fb7185;
  --ok: #22c55e;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 332px minmax(0, 1fr);
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

button,
input {
  font: inherit;
}

.login-view {
  position: relative;
  grid-column: 1 / -1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.18), transparent 34%),
    var(--bg);
}

.login-paths {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: rgba(232, 221, 255, 0.62);
  opacity: 0.72;
  transform: translateZ(0);
}

.login-paths svg {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  filter: drop-shadow(0 0 18px rgba(139, 92, 246, 0.18));
  animation: pathsFloat 18s ease-in-out infinite alternate;
}

.login-paths path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.1;
  opacity: 0.16;
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
  animation: pathDraw 12s ease-in-out infinite;
}

.login-paths path:nth-child(2n) {
  opacity: 0.24;
  animation-delay: -2s;
}

.login-paths path:nth-child(3n) {
  stroke-width: 1.6;
  animation-delay: -5s;
}

.login-paths path:nth-child(4n) {
  opacity: 0.1;
  animation-delay: -8s;
}

.panel-paths {
  z-index: 0;
  opacity: 0.46;
  color: rgba(216, 180, 254, 0.72);
}

.panel-paths svg {
  inset: -14%;
  width: 128%;
  height: 128%;
  filter: drop-shadow(0 0 14px rgba(139, 92, 246, 0.12));
  animation-duration: 24s;
}

.panel-paths path {
  opacity: 0.2;
  animation-duration: 18s;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 13, 29, 0.86);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.login-brand {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
}

.login-avatar {
  width: 86px;
  height: 86px;
  border-radius: 22px;
  object-fit: cover;
  border: 2px solid rgba(192, 132, 252, 0.72);
  box-shadow: 0 0 34px rgba(139, 92, 246, 0.45);
}

.login-card h1 {
  margin-bottom: 4px;
}

.login-card h1 span {
  display: inline-block;
  color: transparent;
  background: linear-gradient(90deg, #fff, rgba(216, 180, 254, 0.84));
  background-clip: text;
  -webkit-background-clip: text;
  animation: titleLetter 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-card .eyebrow {
  margin: 4px 0 0;
}

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.login-card input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #100c19;
  outline: none;
}

.login-card input:focus {
  border-color: rgba(192, 132, 252, 0.75);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

.login-card button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  font-weight: 800;
}

.login-card button:hover {
  background: #7c3aed;
}

#loginStatus {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@keyframes pathsFloat {
  from {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }

  to {
    transform: translate3d(1.5%, 1%, 0) scale(1.015);
  }
}

@keyframes pathDraw {
  0% {
    stroke-dashoffset: 620;
  }

  50% {
    stroke-dashoffset: 0;
  }

  100% {
    stroke-dashoffset: -620;
  }
}

@keyframes titleLetter {
  from {
    opacity: 0;
    transform: translateY(42px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-paths svg,
  .login-paths path,
  .login-card h1 span {
    animation: none;
  }

  .login-paths path {
    stroke-dashoffset: 0;
  }
}

.sidebar {
  min-height: 100vh;
  padding: 22px;
  background: #0d0a15;
  border-right: 1px solid var(--line);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand-avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(192, 132, 252, 0.72);
  box-shadow: 0 0 28px rgba(139, 92, 246, 0.38);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  letter-spacing: 0;
}

.brand small {
  color: var(--muted);
  margin-top: 3px;
}

.search span {
  display: block;
  margin-bottom: 7px;
  color: #c4b5fd;
  font-size: 13px;
}

.search input,
.form-row input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #100c19;
  outline: none;
}

.search input:focus,
.form-row input:focus {
  border-color: rgba(192, 132, 252, 0.75);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

.group-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.group-item {
  width: 100%;
  min-height: 62px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px;
  text-align: left;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-item:hover,
.group-item.active {
  background: #171124;
  border-color: rgba(192, 132, 252, 0.28);
}

.group-item.active {
  box-shadow: inset 3px 0 0 var(--brand);
}

.group-avatar,
.group-hero-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  font-weight: 800;
  background: #31214d;
  border: 1px solid rgba(192, 132, 252, 0.35);
  overflow: hidden;
}

.group-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 15px;
}

.group-avatar img,
.group-hero-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.group-avatar span,
.group-hero-avatar span {
  position: relative;
  z-index: 0;
}

.group-copy {
  min-width: 0;
  display: block;
}

.group-copy strong,
.group-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.main {
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding: 26px;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 0%, rgba(139, 92, 246, 0.10), transparent 32%),
    radial-gradient(circle at 20% 55%, rgba(192, 132, 252, 0.08), transparent 28%);
}

.main > :not(.panel-paths) {
  position: relative;
  z-index: 1;
}

.topbar,
.panel-heading,
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topbar {
  margin-bottom: 22px;
}

.current-group {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.group-hero-avatar {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  font-size: 24px;
  box-shadow: 0 18px 40px rgba(139, 92, 246, 0.18);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand-2);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 17px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #151020;
  cursor: pointer;
}

.icon-button:hover {
  border-color: rgba(192, 132, 252, 0.48);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.bot-status {
  margin-bottom: 18px;
}

.bot-card {
  display: grid;
  gap: 16px;
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.system-grid article {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #100c19;
}

.system-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.system-grid strong {
  display: block;
  color: #fff;
  font-size: 24px;
  overflow-wrap: anywhere;
}

#statusChart {
  width: 100%;
  height: 180px;
  display: block;
  border-radius: 8px;
  background: #14101f;
}

.session-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.session-list article {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 12, 25, 0.78);
}

.session-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fb7185;
  box-shadow: 0 0 12px rgba(251, 113, 133, 0.6);
}

.session-dot.online {
  background: var(--ok);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
}

.session-copy {
  min-width: 0;
}

.session-copy strong,
.session-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-copy small {
  margin-top: 3px;
  color: var(--muted);
}

.session-list b {
  color: var(--muted);
  font-size: 12px;
}

.metrics article,
.panel {
  background: rgba(20, 16, 31, 0.86);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metrics article {
  padding: 18px;
  background: rgba(21, 16, 32, 0.86);
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metrics strong {
  font-size: 31px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  padding: 18px;
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading span,
#saveStatus {
  color: var(--muted);
  font-size: 13px;
}

.group-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  align-items: end;
}

.form-row label {
  flex: 1;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.file-picker {
  position: relative;
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px;
  background: #100c19;
}

.file-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 12px;
  color: #fff;
  background: #2b2040;
  border: 1px solid rgba(192, 132, 252, 0.28);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.file-name {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.file-picker:hover .file-button {
  background: #3a2a59;
  border-color: rgba(192, 132, 252, 0.48);
}

.form-row button {
  height: 42px;
  min-width: 92px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
}

.form-row button:hover {
  background: #7c3aed;
}

.chart-panel canvas {
  width: 100%;
  height: 300px;
  display: block;
  border-radius: 8px;
  background: #14101f;
}

.protections-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.insights-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.blacklist-grid,
.logs-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.blacklist-grid article,
.logs-list article {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(26, 19, 40, 0.82);
}

.blacklist-grid strong,
.blacklist-grid span,
.logs-list strong,
.logs-list small,
.log-action {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blacklist-grid strong,
.logs-list strong {
  color: #fff;
  font-size: 14px;
}

.blacklist-grid span,
.logs-list small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.log-action {
  margin-bottom: 6px;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.empty-state {
  display: block;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(16, 12, 25, 0.74);
}

.support-panel {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.support-panel p {
  margin: 8px 0 0;
  color: var(--muted);
}

.support-panel a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  background: #22c55e;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.support-panel a:hover {
  background: #16a34a;
}

.access-panel {
  margin-top: 18px;
}

.all-passwords-form {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(192, 132, 252, 0.25);
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.08);
}

.all-passwords-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.password-field,
.access-password-form {
  display: flex;
  gap: 8px;
}

.password-field input,
.access-password-form input {
  min-width: 0;
  flex: 1;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #100c19;
  outline: none;
}

.password-field button,
.access-password-form button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 10px;
}

.access-grid article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.access-grid span,
.access-grid strong,
.access-grid small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-grid span {
  color: var(--muted);
  font-size: 13px;
}

.access-grid strong {
  margin-top: 7px;
  color: #fff;
  font-size: 19px;
}

.access-grid small {
  margin-top: 6px;
  color: #7c728d;
}

.access-password-form {
  margin-top: 12px;
}

.toggle {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.toggle span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}

.switch input {
  opacity: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #4b3b63;
  cursor: pointer;
}

.slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
}

.switch input:checked + .slider {
  background: var(--brand);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.owner-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 18px;
}

.owner-connect-form {
  display: grid;
  grid-template-columns: 1fr 1.25fr auto;
  gap: 12px;
  align-items: end;
}

.owner-connect-form label,
.owner-settings label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.owner-connect-form input,
.owner-settings input,
.owner-settings select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #100c19;
  outline: none;
}

.owner-connect-form button,
.owner-settings button,
.owner-session-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #6d28d9);
  cursor: pointer;
}

.pairing-box {
  margin-top: 14px;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 16px;
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.08);
  text-align: center;
}

.pairing-box strong {
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 7px;
  color: #86efac;
}

.pairing-box span,
.pairing-box small {
  color: var(--muted);
}

.owner-sessions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.owner-session-card {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 7, 16, 0.42);
}

.owner-session-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.owner-session-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.owner-session-actions .danger {
  background: rgba(251, 113, 133, 0.18);
  color: #fda4af;
}

.owner-settings {
  display: grid;
  align-content: start;
  gap: 12px;
}

.owner-settings .form-row {
  margin: 0;
}

.owner-settings .form-row > label {
  min-width: 0;
  flex: 1;
}

.sub-owners-form {
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 1px solid rgba(192, 132, 252, 0.22);
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.07);
}

.sub-owners-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sub-owners-heading strong,
.sub-owners-heading small {
  display: block;
}

.sub-owners-heading small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.sub-owners-heading button {
  flex: 0 0 auto;
}

.sub-owners-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.sub-owners-grid label {
  display: grid;
  gap: 6px;
}

.sub-owners-grid input {
  min-width: 0;
}

.upload-picker {
  position: relative;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 11px;
  overflow: hidden;
  border: 1px dashed rgba(192, 132, 252, 0.38);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  background: rgba(16, 12, 25, 0.88);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.upload-picker:hover {
  border-color: var(--brand-2);
  background: rgba(49, 33, 77, 0.45);
}

.upload-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  width: 42px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #ddd6fe;
  background: rgba(139, 92, 246, 0.22);
  font-size: 11px;
  font-weight: 900;
}

.upload-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.upload-copy strong,
.upload-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-copy strong {
  font-size: 13px;
}

.upload-copy small {
  color: var(--muted);
  font-size: 11px;
}

.upload-picker.compact {
  min-height: 44px;
  padding-block: 5px;
}

.upload-picker.compact .upload-icon {
  width: 36px;
  height: 31px;
}

.profile-fields {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(180px, 1.3fr);
  gap: 8px;
}

.owner-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.reactions-panel {
  margin-top: 18px;
}

.panel-description {
  margin: 8px 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.new-reaction-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(100px, 0.35fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(192, 132, 252, 0.25);
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.08);
}

.new-reaction-form label,
.reaction-card label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.new-reaction-form input,
.reaction-card input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #100c19;
  outline: none;
}

.emoji-input {
  font-size: 21px;
  text-align: center;
}

.new-reaction-form button,
.reaction-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

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

.reaction-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 82px;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}

.reaction-owner {
  align-self: center;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.reaction-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.reaction-actions button {
  min-height: 34px;
  padding-inline: 11px;
  font-size: 12px;
}

.reaction-actions .danger {
  color: #fda4af;
  background: rgba(251, 113, 133, 0.18);
}

@media (max-width: 1050px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .group-list {
    max-height: 260px;
  }

  .metrics,
  .system-grid,
  .session-list,
  .workspace,
  .insights-grid,
  .access-grid,
  .protections-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 760px) {
  body {
    display: block;
  }

  .main,
  .sidebar {
    padding: 14px;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    align-items: center;
  }

  .brand {
    width: min(520px, 100%);
    justify-content: center;
    text-align: center;
  }

  .search {
    width: min(520px, 100%);
  }

  .group-list {
    width: 100%;
    max-height: none;
    display: flex;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 8px;
  }

  .group-item {
    flex: 0 0 min(520px, 86vw);
  }

  .group-item:only-child {
    margin-inline: auto;
  }

  .metrics,
  .system-grid,
  .session-list,
  .workspace,
  .insights-grid,
  .access-grid,
  .protections-grid {
    grid-template-columns: 1fr;
  }

  .owner-connect-form,
  .owner-session-card,
  .profile-fields,
  .sub-owners-grid,
  .password-field,
  .access-password-form,
  .new-reaction-form,
  .reaction-card {
    grid-template-columns: 1fr;
  }

  .password-field,
  .access-password-form {
    display: grid;
  }

  .sub-owners-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .owner-session-actions {
    justify-content: stretch;
  }

  .owner-session-actions button {
    flex: 1;
  }

  .topbar,
  .form-row,
  .support-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    position: relative;
    text-align: center;
  }

  .current-group {
    flex-direction: column;
    justify-content: center;
  }

  .icon-button {
    position: absolute;
    top: 0;
    right: 0;
  }

  h1 {
    font-size: 22px;
  }

  .panel {
    padding: 14px;
  }

  .metrics article {
    text-align: center;
  }

  .form-row button {
    width: 100%;
  }

  .chart-panel canvas {
    height: 240px;
  }

  #statusChart {
    height: 160px;
  }

  .support-panel {
    text-align: center;
  }

  .support-panel a {
    width: 100%;
  }
}

/* ===== Dashboard autenticado: layout SaaS responsivo ===== */
body.dashboard-active {
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  grid-template-columns: 300px minmax(0, 1fr);
}

body.dashboard-active button,
body.dashboard-active input,
body.dashboard-active select,
body.dashboard-active textarea,
body.dashboard-active canvas,
body.dashboard-active img,
body.dashboard-active form,
body.dashboard-active section,
body.dashboard-active article,
body.dashboard-active div {
  max-width: 100%;
}

body.dashboard-active button,
body.dashboard-active input,
body.dashboard-active select {
  min-height: 44px;
}

body.dashboard-active button {
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

body.dashboard-active button:hover:not(:disabled) {
  transform: translateY(-1px);
}

body.dashboard-active button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.sidebar-backdrop {
  display: none;
}

body.dashboard-active .sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 300px;
  height: 100dvh;
  min-height: 0;
  padding: 18px 16px;
  gap: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 0%, rgba(139, 92, 246, 0.12), transparent 28%),
    #0d0a15;
  box-shadow: 18px 0 50px rgba(0, 0, 0, 0.22);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.dashboard-active .brand {
  min-width: 0;
  flex: 1;
  min-height: 0;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

body.dashboard-active .brand:disabled {
  cursor: default;
  opacity: 1;
}

body.dashboard-active .brand.is-home strong {
  color: #ddd6fe;
}

body.dashboard-active .brand-avatar {
  width: 46px;
  height: 46px;
}

.sidebar-close {
  display: none;
  position: relative;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px !important;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  color: var(--text);
  background: #171124;
  font-size: 0;
  line-height: 0;
}

.sidebar-close::before,
.sidebar-close::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.sidebar-close::before {
  transform: rotate(45deg);
}

.sidebar-close::after {
  transform: rotate(-45deg);
}

body.dashboard-active .search {
  position: sticky;
  top: 0;
  z-index: 2;
  isolation: isolate;
  display: block;
  padding: 10px 7px 15px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 14% 55%, rgba(139, 92, 246, 0.22), transparent 42%),
    linear-gradient(135deg, rgba(30, 20, 48, 0.72), rgba(13, 10, 21, 0.3));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.025),
    0 12px 34px rgba(0, 0, 0, 0.18);
}

body.dashboard-active .search::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -12px -8px;
  border-radius: 22px;
  pointer-events: none;
  opacity: 0.72;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.18), transparent 68%);
  filter: blur(12px);
}

body.dashboard-active .search input {
  height: 44px;
  border-radius: 10px;
  background: rgba(12, 9, 19, 0.82);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

body.dashboard-active .search input:hover {
  border-color: rgba(192, 132, 252, 0.42);
  background: #151020;
}

body.dashboard-active .search:focus-within input {
  border-color: rgba(192, 132, 252, 0.9);
  background: #151020;
  box-shadow:
    0 0 0 3px rgba(139, 92, 246, 0.18),
    0 0 24px rgba(139, 92, 246, 0.24);
}

body.dashboard-active .search:focus-within > span {
  color: #e9d5ff;
  text-shadow: 0 0 14px rgba(192, 132, 252, 0.55);
}

.sidebar-list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
  color: #ddd6fe;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-list-heading small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-transform: none;
}

body.dashboard-active .group-list {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 4px 18px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.55) transparent;
}

body.dashboard-active .group-item {
  width: 100%;
  min-height: 60px;
  flex: 0 0 auto;
  padding: 9px 10px;
  border: 1px solid rgba(196, 181, 253, 0.1);
  border-radius: 12px;
  background: rgba(23, 17, 36, 0.58);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

body.dashboard-active .group-item:hover,
body.dashboard-active .group-item.active {
  background: rgba(35, 24, 54, 0.94);
  border-color: rgba(192, 132, 252, 0.36);
}

body.dashboard-active .group-item.active {
  box-shadow: inset 3px 0 0 var(--brand), 0 10px 28px rgba(0, 0, 0, 0.2);
}

body.dashboard-active .group-avatar {
  width: 40px;
  height: 40px;
}

body.dashboard-active .group-copy strong {
  font-size: 13px;
}

body.dashboard-active .group-copy span {
  font-size: 10px;
}

body.dashboard-active .main {
  width: 100%;
  max-width: 100%;
  min-height: 100dvh;
  padding: 24px clamp(18px, 2.4vw, 36px) 44px;
  overflow-x: hidden;
}

body.dashboard-active .main > :not(.panel-paths) {
  width: min(1500px, 100%);
  margin-inline: auto;
}

body.dashboard-active .topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  min-height: 78px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid rgba(196, 181, 253, 0.13);
  border-radius: 16px;
  background: rgba(13, 10, 21, 0.86);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
}

.menu-button {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto;
}

.menu-button span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

body.dashboard-active .current-group {
  flex: 1;
}

body.dashboard-active .group-hero-avatar {
  width: 54px;
  height: 54px;
  border-radius: 14px;
}

body.dashboard-active h1 {
  font-size: clamp(21px, 2.4vw, 30px);
}

body.dashboard-active h2 {
  font-size: clamp(16px, 1.4vw, 19px);
}

.dashboard-section {
  margin-top: 18px;
  scroll-margin-top: 100px;
}

.section-heading {
  margin-bottom: 12px;
}

.section-description,
.panel-description {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}

body.dashboard-active .panel {
  min-width: 0;
  padding: clamp(16px, 1.8vw, 22px);
  border-color: rgba(196, 181, 253, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(25, 19, 39, 0.94), rgba(16, 12, 25, 0.94));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}

body.dashboard-active .panel-heading {
  align-items: flex-start;
  margin-bottom: 17px;
}

body.dashboard-active .bot-status {
  margin-bottom: 0;
}

body.dashboard-active .system-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.dashboard-active .system-grid article,
body.dashboard-active .metrics article {
  min-width: 0;
  border: 1px solid rgba(196, 181, 253, 0.13);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(24, 17, 37, 0.94), rgba(13, 10, 21, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

body.dashboard-active .system-grid article {
  min-height: 92px;
}

body.dashboard-active .session-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.dashboard-active .session-list article {
  border-radius: 12px;
}

body.dashboard-active #statusChart,
body.dashboard-active .chart-panel canvas {
  width: 100% !important;
  max-width: 100%;
  border-radius: 12px;
}

body.dashboard-active .owner-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

body.dashboard-active .owner-connect {
  grid-column: 1 / -1;
}

body.dashboard-active .owner-settings,
body.dashboard-active .owner-permissions {
  height: 100%;
}

body.dashboard-active .owner-connect-form {
  grid-template-columns: minmax(160px, 0.8fr) minmax(210px, 1fr) auto;
}

body.dashboard-active .owner-session-card {
  border-radius: 12px;
}

body.dashboard-active .owner-settings input,
body.dashboard-active .owner-settings select,
body.dashboard-active .owner-permissions input,
body.dashboard-active .new-reaction-form input,
body.dashboard-active .reaction-card input,
body.dashboard-active .password-field input,
body.dashboard-active .access-password-form input {
  border-radius: 10px;
}

body.dashboard-active .owner-permissions {
  display: grid;
  align-content: start;
  gap: 12px;
}

body.dashboard-active .owner-permissions label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

body.dashboard-active .owner-permissions input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  padding: 0 12px;
  color: var(--text);
  background: #100c19;
  outline: none;
}

body.dashboard-active .owner-permissions button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  padding: 0 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #6d28d9);
  cursor: pointer;
}

body.dashboard-active .sub-owners-form,
body.dashboard-active .new-reaction-form,
body.dashboard-active .all-passwords-form {
  border-radius: 13px;
}

body.dashboard-active .upload-picker {
  min-width: 0;
}

body.dashboard-active .reactions-panel {
  margin-top: 18px;
}

body.dashboard-active .reaction-card {
  border-radius: 12px;
}

body.dashboard-active .group-stats-section {
  padding: 18px;
  border: 1px solid rgba(196, 181, 253, 0.12);
  border-radius: 16px;
  background: rgba(13, 10, 21, 0.45);
}

body.dashboard-active .metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

body.dashboard-active .metrics article {
  padding: 17px;
}

body.dashboard-active .workspace,
body.dashboard-active .insights-grid {
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  gap: 16px;
  margin-bottom: 0;
}

body.dashboard-active .form-row {
  min-width: 0;
}

body.dashboard-active .form-row label {
  min-width: 0;
}

body.dashboard-active .protections-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

body.dashboard-active .toggle {
  min-width: 0;
  min-height: 56px;
  border-radius: 11px;
}

body.dashboard-active .toggle > span:first-child {
  line-height: 1.3;
}

body.dashboard-active .blacklist-grid,
body.dashboard-active .logs-list {
  max-height: 380px;
}

body.dashboard-active .blacklist-grid article,
body.dashboard-active .logs-list article,
body.dashboard-active .access-grid article {
  border-radius: 11px;
}

body.dashboard-active .support-panel,
body.dashboard-active .access-panel {
  margin-top: 18px;
}

body.dashboard-active .access-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

@media (max-width: 1024px) {
  body.dashboard-active {
    display: block;
  }

  body.dashboard-active .main {
    padding: 16px 18px 38px;
  }

  body.dashboard-active .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(340px, 88vw);
    height: 100dvh;
    padding: 16px;
    border-right: 1px solid rgba(192, 132, 252, 0.26);
    transform: translateX(-105%);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  body.dashboard-active.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.dashboard-active .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    opacity: 0;
    visibility: hidden;
    background: rgba(3, 2, 7, 0.72);
    backdrop-filter: blur(4px);
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  body.dashboard-active.sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
  }

  body.dashboard-active.sidebar-open {
    overflow: hidden;
  }

  .sidebar-close,
  .menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body.dashboard-active .topbar {
    min-height: 70px;
  }

  body.dashboard-active .system-grid,
  body.dashboard-active .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.dashboard-active .protections-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.dashboard-active .access-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body.dashboard-active .main {
    padding: 10px 12px 32px;
  }

  body.dashboard-active .topbar {
    top: 8px;
    min-height: 64px;
    margin-bottom: 14px;
    padding: 9px 10px;
    border-radius: 13px;
    text-align: left;
    flex-direction: row;
    align-items: center;
  }

  body.dashboard-active .current-group {
    min-width: 0;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
  }

  body.dashboard-active .current-group > div:last-child {
    min-width: 0;
  }

  body.dashboard-active .group-hero-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  body.dashboard-active #groupTitle {
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.dashboard-active .current-group .eyebrow {
    font-size: 10px;
  }

  body.dashboard-active .icon-button {
    position: static;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
  }

  body.dashboard-active .panel {
    padding: 14px;
    border-radius: 14px;
  }

  body.dashboard-active .dashboard-section {
    margin-top: 12px;
  }

  body.dashboard-active .panel-heading {
    gap: 8px;
    margin-bottom: 14px;
  }

  body.dashboard-active .section-description,
  body.dashboard-active .panel-description {
    font-size: 11px;
  }

  body.dashboard-active .session-list,
  body.dashboard-active .owner-panel,
  body.dashboard-active .workspace,
  body.dashboard-active .insights-grid,
  body.dashboard-active .reactions-grid,
  body.dashboard-active .access-grid {
    grid-template-columns: 1fr;
  }

  body.dashboard-active .owner-connect {
    grid-column: auto;
  }

  body.dashboard-active .owner-connect-form,
  body.dashboard-active .new-reaction-form {
    grid-template-columns: 1fr;
  }

  body.dashboard-active .owner-session-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body.dashboard-active .owner-session-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.dashboard-active .owner-session-actions button {
    width: 100%;
  }

  body.dashboard-active .form-row {
    align-items: stretch;
    flex-direction: column;
  }

  body.dashboard-active .form-row button {
    width: 100%;
  }

  body.dashboard-active .profile-fields {
    grid-template-columns: 1fr;
  }

  body.dashboard-active .sub-owners-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.dashboard-active .reaction-card {
    grid-template-columns: minmax(0, 1fr) 76px;
  }

  body.dashboard-active .reaction-actions {
    justify-content: stretch;
  }

  body.dashboard-active .reaction-actions button {
    flex: 1;
  }

  body.dashboard-active .group-stats-section {
    padding: 13px;
  }

  body.dashboard-active .metrics article {
    min-height: 96px;
    padding: 14px;
    text-align: left;
  }

  body.dashboard-active .metrics strong {
    font-size: 27px;
  }

  body.dashboard-active .protections-grid {
    grid-template-columns: 1fr;
  }

  body.dashboard-active .toggle {
    min-height: 52px;
  }

  body.dashboard-active .chart-panel canvas {
    height: 230px;
  }

  body.dashboard-active #statusChart {
    height: 165px;
  }

  body.dashboard-active .support-panel {
    text-align: left;
  }

  body.dashboard-active .support-panel a {
    width: 100%;
  }
}

@media (max-width: 480px) {
  body.dashboard-active .main {
    padding-inline: 8px;
  }

  body.dashboard-active .topbar {
    gap: 8px;
    padding-inline: 8px;
  }

  body.dashboard-active .group-hero-avatar {
    display: none;
  }

  body.dashboard-active .panel {
    padding: 12px;
    border-radius: 12px;
  }

  body.dashboard-active .system-grid,
  body.dashboard-active .metrics {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body.dashboard-active .system-grid article,
  body.dashboard-active .metrics article {
    min-height: 84px;
    padding: 12px;
  }

  body.dashboard-active .system-grid strong {
    font-size: 20px;
  }

  body.dashboard-active .metrics strong {
    font-size: 24px;
  }

  body.dashboard-active .session-list article {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body.dashboard-active .session-list b {
    grid-column: 2;
  }

  body.dashboard-active .owner-session-actions {
    grid-template-columns: 1fr;
  }

  body.dashboard-active .sub-owners-grid,
  body.dashboard-active .reaction-card {
    grid-template-columns: 1fr;
  }

  body.dashboard-active .reaction-owner,
  body.dashboard-active .reaction-actions {
    grid-column: 1;
  }

  body.dashboard-active .sub-owners-heading {
    align-items: stretch;
    flex-direction: column;
  }

  body.dashboard-active .sub-owners-heading button {
    width: 100%;
  }

  body.dashboard-active .password-field,
  body.dashboard-active .access-password-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.dashboard-active .file-picker {
    grid-template-columns: 1fr;
    text-align: center;
  }

  body.dashboard-active .file-name {
    padding: 4px 8px;
  }

  body.dashboard-active .panel-heading {
    flex-direction: column;
    align-items: stretch;
  }

  body.dashboard-active .chart-panel canvas {
    height: 205px;
  }
}
