* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent: #f6b82e;
  --accent-strong: #ffc63d;
  --accent-soft: rgba(246, 184, 46, 0.12);
  --success: #53d89b;
  --danger: #ff6575;
  --warning: #f6b82e;
  --bg: #080b09;
  --sidebar: rgba(6, 10, 8, 0.97);
  --panel: rgba(17, 22, 19, 0.94);
  --panel-2: rgba(22, 28, 24, 0.92);
  --panel-3: rgba(29, 35, 31, 0.86);
  --text: #f2f4f2;
  --muted: #7d8982;
  --muted-2: #a2aaa5;
  --line: rgba(255, 255, 255, 0.065);
  --line-accent: rgba(246, 184, 46, 0.22);
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
label,
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body.app-checking #loginScreen,
body.app-checking #mainApp {
  visibility: hidden;
}

body:has(#mainApp[style*="block"]) {
  overflow: hidden;
}

/* Area autenticada */
#mainApp {
  position: relative;
  isolation: isolate;
  width: 100vw;
  height: 100dvh;
  min-height: 320px;
  overflow: hidden;
}

#mainApp[style*="block"] {
  display: grid !important;
  grid-template-columns: clamp(158px, 20vw, 196px) minmax(0, 1fr);
  grid-template-rows: clamp(60px, 11vh, 72px) minmax(0, 1fr);
  grid-template-areas:
    "sidebar header"
    "sidebar content";
}

#mainApp::before {
  content: "";
  position: fixed;
  inset: -14px;
  z-index: -2;
  background: url("assets/gourp-dashboard-bg.png") center 48% / cover no-repeat;
  filter: blur(5px) brightness(0.42) saturate(0.72);
  transform: scale(1.035);
  pointer-events: none;
}

#mainApp::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 8, 6, 0.98) 0%, rgba(7, 11, 8, 0.88) 27%, rgba(8, 12, 9, 0.72) 70%, rgba(5, 8, 6, 0.84) 100%),
    linear-gradient(180deg, rgba(3, 5, 4, 0.38), rgba(3, 5, 4, 0.78));
  pointer-events: none;
}

/* Barra lateral fixa */
.top-menu {
  grid-area: sidebar;
  position: relative;
  z-index: 20;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 15px 10px 11px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  box-shadow: 18px 0 48px rgba(0, 0, 0, 0.16);
}

.brand-block {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 7px;
}

.brand-logo {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 6px;
  border: 1px solid rgba(246, 184, 46, 0.22);
  border-radius: 14px;
  background: rgba(246, 184, 46, 0.11);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transform: none;
}

.brand-block > div:last-child {
  min-width: 0;
}

.brand-block strong {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 820;
  letter-spacing: 0.25px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-block span {
  display: block;
  margin-top: 3px;
  color: #6e7a72;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.9px;
}

.nav-caption {
  margin: 19px 10px 8px;
  color: #536058;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 1px;
}

.tab-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tab-btn {
  position: relative;
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #87928b;
  font-size: 11px;
  font-weight: 620;
  text-align: left;
  cursor: pointer;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}

.tab-btn::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -1px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
}

.tab-btn:hover {
  color: #d4d8d5;
  background: rgba(255, 255, 255, 0.025);
}

.tab-btn.active {
  border-color: rgba(246, 184, 46, 0.1);
  background: rgba(246, 184, 46, 0.11);
  color: var(--accent-strong);
}

.tab-btn.active::before {
  background: var(--accent);
  box-shadow: 0 0 11px rgba(246, 184, 46, 0.46);
}

.tab-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: currentColor;
  font-size: 13px;
}

.tab-btn.active .tab-icon {
  background: rgba(246, 184, 46, 0.11);
}

.tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-profile {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.profile-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(246, 184, 46, 0.12);
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 800;
}

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

.profile-copy strong {
  display: block;
  overflow: hidden;
  font-size: 8px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy small {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  color: #667169;
  font-size: 6px;
  white-space: nowrap;
}

.profile-copy i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 7px rgba(246, 184, 46, 0.48);
}

/* Barra superior */
.header {
  grid-area: header;
  position: relative;
  z-index: 10;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 9, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-heading {
  min-width: 0;
  margin-right: auto;
}

.header-title {
  color: #f4f5f4;
  font-size: clamp(15px, 2.1vw, 20px);
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.35px;
}

.server-ip {
  overflow: hidden;
  margin-top: 5px;
  color: #66736b;
  font-size: 7px;
  font-weight: 650;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-indicator,
.device-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
}

.status-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 7px rgba(246, 184, 46, 0.52);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.42;
  }
}

.status-text,
.device-id-label,
.device-id-code {
  font-size: 7px;
  font-weight: 700;
  white-space: nowrap;
}

.status-text {
  color: var(--accent);
  text-transform: uppercase;
}

.device-id-label {
  color: #646f68;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.device-id-code {
  overflow: hidden;
  max-width: 74px;
  color: #aeb5b0;
  font-family: "Courier New", monospace;
  text-overflow: ellipsis;
}

.status-indicator.offline {
  border-color: rgba(255, 101, 117, 0.15);
}

.status-indicator.offline .status-dot {
  background: var(--danger);
  box-shadow: 0 0 7px rgba(255, 101, 117, 0.45);
  animation: none;
}

.status-indicator.offline .status-text {
  color: var(--danger);
}

.inject-row {
  display: flex;
}

/* Botoes */
.btn {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 8px;
  font-weight: 760;
  cursor: pointer;
  transition: transform 0.16s, filter 0.16s, background 0.16s;
}

.btn:hover,
.btn-inject-big:hover {
  filter: brightness(1.08);
}

.btn:active,
.btn-inject-big:active,
.btn-logout:active {
  transform: scale(0.97);
}

.btn:disabled,
.btn-inject-big:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.btn-inject,
.btn-inject-big {
  border-color: rgba(255, 219, 123, 0.22);
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(155, 106, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: #171408;
}

.btn-inject-big {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  padding: 9px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 780;
  cursor: pointer;
}

.btn-logout {
  padding: 7px 16px;
  border: 1px solid rgba(255, 101, 117, 0.2);
  border-radius: 8px;
  background: rgba(255, 101, 117, 0.08);
  color: #ff8793;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

/* Conteudo */
.tab-content {
  grid-area: content;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 11px 14px 13px;
  scrollbar-width: thin;
  scrollbar-color: rgba(246, 184, 46, 0.34) transparent;
}

.tab-content::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.tab-content::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(246, 184, 46, 0.28);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
  animation: paneIn 0.24s ease both;
}

/* Transmissao ao vivo */
#tab-stream.active {
  grid-template-columns: minmax(0, 1.9fr) minmax(235px, 0.82fr);
  align-items: stretch;
}

.stream-player-card,
.stream-config-card,
.stream-note-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(19, 25, 21, 0.96), rgba(10, 14, 11, 0.97));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
}

.stream-player-card {
  grid-row: span 2;
  padding: 13px;
}

.stream-player-topbar,
.stream-controls,
.stream-config-heading,
.stream-copy-row {
  display: flex;
  align-items: center;
}

.stream-player-topbar {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.stream-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1.35px;
}

.stream-player-topbar h2 {
  font-size: 15px;
  font-weight: 720;
}

.stream-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 6px 9px;
  border: 1px solid rgba(246, 184, 46, 0.18);
  border-radius: 999px;
  background: rgba(246, 184, 46, 0.07);
  color: #dfbd6f;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.55px;
  text-transform: uppercase;
}

.stream-status-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.stream-status-badge.live {
  border-color: rgba(83, 216, 155, 0.24);
  background: rgba(83, 216, 155, 0.08);
  color: var(--success);
}

.stream-status-badge.error {
  border-color: rgba(255, 101, 117, 0.22);
  background: rgba(255, 101, 117, 0.08);
  color: #ff8591;
}

.stream-video-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(246, 184, 46, 0.12);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 42%, rgba(246, 184, 46, 0.08), transparent 38%),
    #030504;
}

.stream-video-shell video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.stream-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 20px;
  text-align: center;
  background: rgba(3, 5, 4, 0.82);
}

.stream-placeholder-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  padding-left: 2px;
  border: 1px solid rgba(246, 184, 46, 0.26);
  border-radius: 50%;
  background: rgba(246, 184, 46, 0.09);
  color: var(--accent);
  font-size: 14px;
}

.stream-placeholder strong {
  font-size: 11px;
}

.stream-placeholder p {
  max-width: 330px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
}

.stream-live-chip {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 5px 7px;
  border-radius: 6px;
  background: #de3348;
  box-shadow: 0 6px 18px rgba(222, 51, 72, 0.32);
  color: #fff;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.75px;
}

.stream-controls {
  gap: 7px;
  margin-top: 10px;
}

.stream-control-btn,
.stream-setup-btn,
.stream-copy-row button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

.stream-control-btn {
  min-height: 31px;
  padding: 7px 9px;
}

.stream-control-btn.primary,
.stream-setup-btn {
  border-color: rgba(246, 184, 46, 0.24);
  background: linear-gradient(135deg, #d89815, #f0b52b);
  color: #181107;
}

.stream-config-card {
  padding: 14px;
}

.stream-config-heading {
  gap: 9px;
}

.stream-config-heading h3 {
  font-size: 11px;
}

.stream-config-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 7.5px;
}

.stream-steps {
  display: grid;
  gap: 7px;
  margin: 13px 0;
  list-style: none;
}

.stream-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.35;
}

.stream-steps li span {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 7px;
  font-weight: 850;
}

.stream-setup-btn {
  width: 100%;
  min-height: 34px;
  padding: 8px 11px;
}

.stream-credentials {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.stream-pair-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(246, 184, 46, 0.18);
  border-radius: 9px;
  background: rgba(246, 184, 46, 0.055);
}

.stream-pair-code span {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stream-pair-code strong {
  color: var(--accent-strong);
  font-family: "Courier New", monospace;
  font-size: 17px;
  letter-spacing: 0.08em;
}

.stream-credentials label {
  display: block;
  margin: 8px 0 5px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.stream-copy-row {
  gap: 5px;
}

.stream-copy-row input {
  min-width: 0;
  width: 100%;
  height: 31px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.25);
  color: #d4d9d5;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 7px;
}

.stream-copy-row button {
  min-height: 31px;
  padding: 7px 8px;
}

.stream-expiry {
  margin-top: 8px;
  color: #68736c;
  font-size: 7px;
  line-height: 1.4;
}

.stream-note-card {
  display: flex;
  gap: 9px;
  padding: 11px 13px;
  color: var(--muted);
  font-size: 7.5px;
  line-height: 1.5;
}

.stream-note-card strong {
  color: #d1d6d2;
}

.stream-placeholder[hidden],
.stream-live-chip[hidden],
.stream-credentials[hidden] {
  display: none !important;
}

.stream-controls {
  flex-wrap: wrap;
}

.stream-control-btn {
  flex: 1 1 auto;
}

.stream-control-btn:disabled,
.stream-setup-btn:disabled,
.stream-copy-row button:disabled {
  opacity: 0.55;
  cursor: wait;
}

@keyframes paneIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(20, 25, 22, 0.96), rgba(14, 18, 16, 0.95));
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.018);
}

.section-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(246, 184, 46, 0.19), transparent);
}

.section-header {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  background: rgba(255, 255, 255, 0.012);
  cursor: pointer;
  user-select: none;
}

.section-icon {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(246, 184, 46, 0.12);
  color: var(--accent);
  font-size: 11px;
}

.section-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #e7eae8;
  font-size: 10px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-title::after {
  content: "MÓDULO";
  display: block;
  margin-top: 3px;
  color: #5e6962;
  font-size: 5px;
  font-weight: 750;
  letter-spacing: 0.8px;
}

.section-chevron {
  color: #626c66;
  font-size: 11px;
  transition: transform 0.2s;
}

.section-card.collapsed .section-chevron {
  transform: rotate(-90deg);
}

.section-body {
  padding: 8px 10px 10px;
}

.section-card.collapsed .section-body {
  display: none;
}

.master-toggle {
  margin-left: auto;
}

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

.option-item {
  min-width: 0;
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 6px 7px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
}

.option-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #aeb5b0;
  font-size: 7px;
  font-weight: 560;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.toggle {
  position: relative;
  width: 32px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-block;
}

.toggle input {
  width: 0;
  height: 0;
  opacity: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  background: #323a35;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9ba39e;
  transition: transform 0.2s, background 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(246, 184, 46, 0.2);
}

.toggle input:checked + .toggle-slider::before {
  background: #201b08;
  transform: translateX(14px);
}

.slider-item {
  padding-top: 8px;
}

.slider-label {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  color: #aeb5b0;
  font-size: 7px;
}

.slider-value {
  margin-left: auto;
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
}

.slider-unit {
  margin-left: 2px;
  color: #6e7771;
  font-size: 6px;
}

.slider {
  width: 100%;
  height: 3px;
  display: block;
  border-radius: 999px;
  outline: none;
  background: #2b322e;
  cursor: pointer;
  -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  border: 2px solid #2b2410;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(246, 184, 46, 0.14);
  cursor: pointer;
  -webkit-appearance: none;
}

.slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid #2b2410;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.inject-status-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px;
  border: 1px dashed rgba(246, 184, 46, 0.17);
  border-radius: 8px;
  background: rgba(246, 184, 46, 0.04);
  color: #8e9891;
  font-size: 8px;
  font-weight: 620;
}

.inject-status-box.injected {
  border-color: rgba(83, 216, 155, 0.25);
  background: rgba(83, 216, 155, 0.06);
  color: var(--success);
}

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

.info-item {
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.018);
}

.info-label {
  display: block;
  margin-bottom: 3px;
  color: #626d66;
  font-size: 5px;
  font-weight: 750;
  letter-spacing: 0.65px;
  text-transform: uppercase;
}

.info-value {
  display: block;
  overflow: hidden;
  color: #cfd4d1;
  font-size: 7px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-value.accent {
  color: var(--accent);
  font-family: "Courier New", monospace;
}

#tab-visuals .section-card {
  grid-column: 1 / -1;
}

#tab-visuals .options-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Login */
.login-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 30%, rgba(246, 184, 46, 0.1), transparent 34%),
    #070a08;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(246, 184, 46, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 184, 46, 0.02) 1px, transparent 1px);
  background-size: 28px 28px;
}

.login-card {
  position: relative;
  width: min(100%, 350px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  padding: 28px 24px 24px;
  border: 1px solid var(--line-accent);
  border-radius: 17px;
  background: rgba(15, 20, 17, 0.96);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.login-card::before {
  content: "";
  width: 34px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.login-title {
  font-size: 23px;
  font-weight: 800;
}

.login-sub,
.login-hint {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.login-hint {
  font-size: 9px;
  opacity: 0.75;
}

.login-reset-link {
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.login-reset-link:hover,
.login-reset-link:focus-visible {
  text-decoration: underline;
}

.token-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: #0b0f0c;
  color: var(--text);
  font-family: "Courier New", monospace;
  font-size: 14px;
  letter-spacing: 2px;
  text-align: center;
}

.token-input:focus {
  border-color: rgba(246, 184, 46, 0.58);
  box-shadow: 0 0 0 3px rgba(246, 184, 46, 0.08);
}

/* Manutencao */
.maintenance-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5000;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 7, 5, 0.96);
}

.maintenance-screen.active {
  display: flex;
}

.maintenance-card {
  width: min(100%, 580px);
  padding: clamp(28px, 6vw, 50px);
  border: 1px solid var(--line-accent);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.maintenance-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
}

.maintenance-badge span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.maintenance-eyebrow {
  margin-top: 28px;
  color: #69746d;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.maintenance-card h1 {
  margin: 8px 0 13px;
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1;
  letter-spacing: -1.5px;
}

.maintenance-copy {
  color: #9aa49d;
  font-size: 14px;
  line-height: 1.6;
}

.discord-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-width: 240px;
  margin-top: 24px;
  padding: 13px 16px;
  border-radius: 9px;
  background: #5865f2;
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.maintenance-divider {
  height: 1px;
  margin: 26px 0 16px;
  background: var(--line);
}

.maintenance-note {
  color: #657068;
  font-size: 10px;
}

body.maintenance-active {
  overflow: hidden;
}

/* Notificacoes */
.toast-container {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 6000;
  max-width: calc(100vw - 20px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  min-width: 190px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(15, 20, 17, 0.97);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.25s ease;
  pointer-events: auto;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(120px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(120px);
  }
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.warning {
  border-left: 3px solid var(--warning);
}

.toast-icon {
  font-size: 13px;
}

.toast-msg {
  font-size: 9px;
}

/* Celular horizontal compacto */
@media (max-height: 500px) and (orientation: landscape) {
  #mainApp[style*="block"] {
    grid-template-columns: clamp(206px, 24vw, 236px) minmax(0, 1fr);
    grid-template-rows: 78px minmax(0, 1fr);
  }

  .top-menu {
    overflow-y: auto;
    padding: 16px 14px 13px;
  }

  .brand-block {
    gap: 12px;
    padding-inline: 4px;
  }

  .brand-logo {
    width: 58px;
    height: 58px;
    padding: 7px;
  }

  .brand-logo img {
    width: 100%;
    height: 100%;
  }

  .brand-block strong {
    font-size: 14px;
  }

  .brand-block span {
    font-size: 8.5px;
  }

  .nav-caption {
    margin: 18px 10px 9px;
    font-size: 8.5px;
  }

  .tab-btn {
    min-height: 52px;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
  }

  .tab-icon {
    width: 35px;
    height: 35px;
    font-size: 15px;
  }

  .sidebar-profile {
    gap: 10px;
    padding: 12px;
    border-radius: 13px;
  }

  .profile-mark {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }

  .profile-copy strong {
    font-size: 10px;
  }

  .profile-copy small {
    font-size: 7.5px;
  }

  .header {
    padding: 12px 18px;
    gap: 12px;
  }

  .header-title {
    font-size: 22px;
  }

  .server-ip {
    font-size: 8.5px;
  }

  .status-indicator,
  .device-info {
    min-height: 36px;
    padding: 8px 12px;
  }

  .status-text,
  .device-id-label,
  .device-id-code {
    font-size: 8.8px;
  }

  .btn {
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 10px;
  }

  .tab-content {
    padding: 15px 17px 18px;
  }

  .tab-pane.active {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .section-header {
    min-height: 58px;
    gap: 10px;
    padding: 11px 13px;
  }

  .section-icon {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  .section-body {
    padding: 13px 14px 15px;
  }

  .options-grid {
    gap: 8px;
  }

  .option-item {
    min-height: 44px;
    padding: 9px 10px;
    border-radius: 9px;
  }

  .slider-item {
    padding-top: 13px;
  }

  .section-title {
    font-size: 13px;
  }

  .section-title::after {
    font-size: 6px;
  }

  .option-label,
  .slider-label {
    font-size: 10px;
  }

  .slider-value {
    font-size: 11px;
  }

  .toggle {
    width: 42px;
    height: 23px;
  }

  .toggle-slider::before {
    width: 13px;
    height: 13px;
    left: 4px;
    bottom: 4px;
  }

  .toggle input:checked + .toggle-slider::before {
    transform: translateX(19px);
  }

  .slider {
    height: 5px;
  }

  .slider::-webkit-slider-thumb {
    width: 17px;
    height: 17px;
  }

  .info-item {
    padding: 10px;
  }

  .info-label {
    font-size: 6.5px;
  }

  .info-value,
  .inject-status-box {
    font-size: 10px;
  }
}

@media (max-width: 700px) and (orientation: landscape) {
  #mainApp[style*="block"] {
    grid-template-columns: 188px minmax(0, 1fr);
    grid-template-rows: 74px minmax(0, 1fr);
  }

  .brand-block {
    gap: 10px;
    padding-inline: 2px;
  }

  .brand-block strong {
    font-size: 13px;
  }

  .header-title {
    font-size: 19px;
  }

  .device-id-label {
    display: none;
  }

  .status-indicator,
  .device-info {
    padding-inline: 8px;
  }

  .btn {
    padding-inline: 11px;
  }

  .tab-pane.active {
    grid-template-columns: minmax(0, 1fr);
  }

  #tab-stream.active {
    grid-template-columns: minmax(0, 1fr);
  }

  .stream-player-card {
    grid-row: auto;
  }
}

/* Em pe, a area autenticada vira um painel vertical completo. */
@media (max-width: 700px) and (orientation: portrait) {
  #mainApp[style*="block"] {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
      "sidebar"
      "header"
      "content";
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  #mainApp::before {
    background-position: center top;
    filter: blur(6px) brightness(0.34) saturate(0.66);
  }

  #mainApp::after {
    background:
      linear-gradient(180deg, rgba(5, 8, 6, 0.96) 0%, rgba(8, 12, 9, 0.88) 34%, rgba(5, 8, 6, 0.94) 100%),
      linear-gradient(90deg, rgba(246, 184, 46, 0.05), transparent 48%, rgba(246, 184, 46, 0.035));
  }

  .top-menu {
    grid-area: sidebar;
    display: block;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(6, 10, 8, 0.96);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.2);
  }

  .brand-block {
    gap: 10px;
    padding: 0;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
    padding: 6px;
    border-radius: 14px;
  }

  .brand-block strong {
    font-size: 14px;
  }

  .brand-block span {
    font-size: 8px;
  }

  .nav-caption {
    display: none;
  }

  .tab-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin-top: 10px;
  }

  .tab-btn {
    min-height: 48px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 6px;
    border-radius: 11px;
    font-size: 10.5px;
    text-align: center;
  }

  .tab-btn::before {
    top: auto;
    right: 10px;
    bottom: -1px;
    left: 10px;
    width: auto;
    height: 2px;
  }

  .tab-icon {
    width: 30px;
    height: 28px;
    border-radius: 8px;
    font-size: 14px;
  }

  .tab-label {
    white-space: normal;
  }

  .sidebar-profile {
    display: none;
  }

  .header {
    grid-area: header;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
  }

  .header-heading {
    flex: 1 0 100%;
    width: 100%;
  }

  .header-title {
    font-size: 18px;
    letter-spacing: 0;
  }

  .server-ip {
    margin-top: 4px;
    font-size: 8px;
  }

  .header-top {
    flex: 1 1 auto;
    min-width: 0;
  }

  .status-indicator,
  .device-info {
    min-height: 33px;
    padding: 7px 10px;
  }

  .status-text,
  .device-id-label,
  .device-id-code {
    font-size: 8px;
  }

  .device-id-code {
    max-width: 86px;
  }

  .inject-row {
    flex: 0 0 auto;
  }

  .btn {
    min-height: 34px;
    padding: 8px 12px;
    font-size: 9px;
  }

  .tab-content {
    grid-area: content;
    min-height: 0;
    padding: 12px;
    overflow: auto;
  }

  .tab-pane.active {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  #tab-stream.active {
    grid-template-columns: minmax(0, 1fr);
  }

  .stream-player-card {
    grid-row: auto;
  }

  #tab-visuals .section-card {
    grid-column: auto;
  }

  #tab-visuals .options-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-card {
    border-radius: 12px;
  }

  .section-header {
    min-height: 54px;
    gap: 10px;
    padding: 10px 12px;
  }

  .section-icon {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .section-title {
    font-size: 13px;
  }

  .section-title::after {
    font-size: 6px;
  }

  .section-body {
    padding: 12px;
  }

  .options-grid,
  .info-grid {
    gap: 8px;
  }

  .option-item {
    min-height: 42px;
    padding: 9px 10px;
    border-radius: 9px;
  }

  .option-label,
  .slider-label {
    font-size: 10px;
  }

  .slider-item {
    padding-top: 13px;
  }

  .slider-value {
    font-size: 11px;
  }

  .toggle {
    width: 40px;
    height: 22px;
  }

  .toggle-slider::before {
    left: 4px;
    bottom: 4px;
    width: 12px;
    height: 12px;
  }

  .toggle input:checked + .toggle-slider::before {
    transform: translateX(18px);
  }

  .slider {
    height: 5px;
  }

  .slider::-webkit-slider-thumb {
    width: 17px;
    height: 17px;
  }

  .info-item {
    padding: 10px;
  }

  .info-label {
    font-size: 6.5px;
  }

  .info-value,
  .inject-status-box {
    font-size: 10px;
  }
}

@media (max-width: 380px) and (orientation: portrait) {
  .header-top,
  .inject-row {
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .tab-btn {
    font-size: 9.5px;
  }

  .device-info {
    flex: 1;
  }
}

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