@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #101019;
  --panel: #191925;
  --panel2: #20202e;
  --border: #2c2c3c;
  --text: #f4f2fb;
  --muted: #9291a6;
  --purple: #9b7aff;
  --green: #55d6a0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
}

button { font: inherit; }

.app { min-height: 100vh; }

.sidebar {
  width: 245px;
  position: fixed;
  inset: 0 auto 0 0;
  background: #151520;
  border-right: 1px solid var(--border);
  padding: 27px 17px;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 38px; }
.brand-icon {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  font-size: 23px; font-weight: 800;
  background: linear-gradient(135deg,#a78bfa,#6742d8);
  box-shadow: 0 5px 25px #7954e54a;
}
.brand strong { display: block; font-size: 18px; }
.brand span { display: block; color: var(--muted); font-size: 9px; letter-spacing: 2px; margin-top: 3px; }

.menu-label { color: #68687d; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; padding: 15px 11px 10px; }
nav { display: grid; gap: 5px; }
.nav-item {
  color: #a6a5b7; text-decoration: none; padding: 12px 13px;
  border-radius: 9px; font-size: 14px; display: flex; gap: 13px;
  align-items: center; transition: .2s;
}
.nav-item:hover, .nav-item.active { color: white; background: #302747; }
.nav-item.active { box-shadow: inset 3px 0 var(--purple); }

.sidebar-bottom { margin-top: auto; }
.connection-box {
  background: #1e1e2b; border: 1px solid var(--border);
  border-radius: 11px; padding: 13px; display: flex; gap: 10px; align-items: center;
  margin-bottom: 18px;
}
.connection-box strong, .user-profile strong { font-size: 12px; display: block; }
.connection-box small, .user-profile small { color: var(--muted); font-size: 10px; display: block; margin-top: 3px; }
.status-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; display: inline-block; box-shadow: 0 0 10px #55d6a080; flex-shrink: 0; }
.user-profile { display: flex; align-items: center; gap: 10px; padding: 10px 5px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #47356d; color: #d9caff; font-weight: 800; }

.main { margin-left: 245px; padding: 34px 42px; max-width: 1700px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.eyebrow { font-size: 10px; letter-spacing: 2px; color: var(--purple); font-weight: 700; }
h1 { font-size: 29px; margin: 7px 0 4px; }
.topbar p, .section-heading p, .panel-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 17px; }
.server-status { border: 1px solid var(--border); border-radius: 30px; padding: 9px 13px; color: #b8b6c8; font-size: 11px; display: flex; align-items: center; gap: 8px; }

.live-banner {
  border: 1px solid #40335d; border-radius: 14px; padding: 20px 23px;
  background: linear-gradient(110deg,#282039,#1c1c2b 70%);
  display: flex; justify-content: space-between; align-items: center; gap: 15px;
}
.live-info, .live-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.live-icon { width: 43px; height: 43px; border-radius: 12px; background: #6948a8; display: grid; place-items: center; font-size: 21px; }
.live-title { font-size: 14px; font-weight: 700; }
.live-subtitle { color: #aaa4bc; font-size: 11px; margin-top: 5px; }
.offline-label { font-size: 10px; color: #f39baf; letter-spacing: .8px; }
.button { border: 0; border-radius: 8px; padding: 10px 13px; font-size: 11px; font-weight: 700; cursor: pointer; transition: .2s; }
.button:disabled { cursor: not-allowed; opacity: .65; }
.button-muted { background: #3a3449; color: #c4b6df; }

.section-heading { display: flex; justify-content: space-between; align-items: end; margin: 30px 0 15px; }
h2 { font-size: 15px; margin: 0 0 5px; }
.period, .test-tag { color: #b9a6ef; font-size: 9px; letter-spacing: 1px; background: #302644; border-radius: 5px; padding: 7px 9px; }

.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.stat-card, .panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.stat-card { padding: 17px; min-width: 0; }
.stat-top { display: flex; justify-content: space-between; align-items: center; color: #aaa8bb; font-size: 11px; gap: 5px; }
.stat-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; font-size: 15px; }
.purple { color: #bba5ff; background: #34294e; }
.pink { color: #ff9bc5; background: #48293f; }
.blue { color: #86baff; background: #263a50; }
.green { color: #72e0b0; background: #24483d; }
.stat-card > strong { font-size: 27px; display: block; margin: 14px 0 4px; }
.stat-card > small { color: var(--muted); font-size: 10px; }

.content-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 15px; margin-top: 18px; }
.panel { padding: 19px; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 17px; }
.live-tag { color: #71ddb0; font-size: 9px; background: #214438; border-radius: 5px; padding: 6px 8px; }
.connection-mini { color: var(--green); font-size: 10px; }
.event-list, .chat-list { min-height: 170px; max-height: 250px; overflow-y: auto; }
.event-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid #292938; }
.event-symbol { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 9px; background: #302747; color: #c4a9ff; }
.event-info { min-width: 0; flex: 1; }
.event-info strong { font-size: 11px; display: block; }
.event-info small { color: var(--muted); font-size: 10px; }
.event-value { color: #c5b0ff; font-size: 10px; }
.chat-message { border-bottom: 1px solid #292938; padding: 10px 2px; font-size: 11px; overflow-wrap: anywhere; }
.chat-message strong { color: #bca5ff; margin-right: 7px; }
.chat-footer { border-top: 1px solid var(--border); padding-top: 12px; color: var(--muted); font-size: 10px; }
.empty-state { color: #77768a; font-size: 11px; text-align: center; padding: 48px 10px; }

.test-panel { margin-top: 18px; }
.test-controls { display: flex; flex-wrap: wrap; gap: 9px; }
.button-primary { color: white; background: linear-gradient(135deg,#936cf3,#704bd1); }
.button-secondary { color: #d0ccdf; background: #292938; border: 1px solid #3a394b; }
.button:hover:not(:disabled) { filter: brightness(1.2); transform: translateY(-1px); }
.test-feedback { color: var(--green); font-size: 11px; margin-top: 12px; min-height: 15px; }
footer { color: #77768a; text-align: center; font-size: 10px; padding: 28px 0 8px; }
footer span { color: var(--purple); padding: 0 5px; }

@media (max-width: 1000px) {
  .sidebar { width: 205px; }
  .main { margin-left: 205px; padding: 28px 22px; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .sidebar { position: static; width: 100%; height: auto; padding: 14px; }
  .brand { padding-bottom: 12px; }
  .sidebar .menu-label, .sidebar nav, .sidebar-bottom { display: none; }
  .main { margin: 0; padding: 22px 14px; }
  .content-grid { grid-template-columns: 1fr; }
  .live-banner { align-items: flex-start; flex-direction: column; }
  .topbar { align-items: flex-start; }
  .server-status { display: none; }
}

/* =========================================
   SAGELIVE - AUTENTICACION GOOGLE
========================================= */

[hidden] {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(125, 83, 220, 0.18), transparent 55%),
    #0d0c16;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 42px 34px;
  text-align: center;
  background: linear-gradient(145deg, #1b1929, #14131f);
  border: 1px solid rgba(173, 145, 255, 0.18);
  border-radius: 22px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.45);
}

.auth-card h1 {
  color: #ffffff;
  font-size: 29px;
  margin: 0 0 10px;
  letter-spacing: -1px;
}

.auth-card p {
  color: #9995ad;
  font-size: 13px;
  line-height: 1.6;
}

.auth-logo {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  border-radius: 19px;
  color: white;
  font-size: 29px;
  font-weight: 800;
  background: linear-gradient(135deg, #a17bff, #6943c7);
  box-shadow: 0 8px 30px rgba(130, 91, 230, 0.3);
}

.google-login-button {
  width: 100%;
  min-height: 48px;
  margin-top: 24px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #24232a;
  background: #ffffff;
  border: 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.google-login-button:hover {
  background: #eeeeF4;
  transform: translateY(-2px);
}

.google-login-button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.google-login-button svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

#auth-error {
  color: #ff8585;
  font-size: 12px;
  min-height: 18px;
  margin-top: 14px;
}

.auth-footer {
  margin-top: 28px;
  color: #666276;
  font-size: 10px;
}

@media (max-width: 480px) {
  .auth-screen {
    padding: 16px;
  }

  .auth-card {
    padding: 34px 22px;
  }
}
