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

:root {
  --bg-gradient: linear-gradient(135deg, #020617, #0B1120);
  --card-bg: rgba(15, 23, 42, 0.6);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #F8FAFC;
  --muted: #94A3B8;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --danger: #EF4444;
  --ok: #10B981;
  --header-bg: rgba(2, 6, 23, 0.85);
}

* { box-sizing: border-box; }

body { 
  margin: 0; 
  font-family: 'Outfit', Arial, sans-serif; 
  background: var(--bg-gradient); 
  color: var(--text); 
  min-height: 100vh;
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  padding: 30px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nav-brand span { color: var(--accent); }

.nav-links {
  display: flex;
  flex-direction: column;
  padding: 20px 15px;
  gap: 8px;
  flex: 1;
}

.nav-links a {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  transition: 0.2s all;
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links a:hover, .nav-links a.active {
  color: #fff;
  background: rgba(255,255,255,0.05);
}
.nav-links a.active {
  background: var(--accent);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  cursor: pointer;
}

.user-profile img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.user-profile .user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.user-profile .user-name {
  font-size: 14px;
  font-weight: 700;
}

.user-profile .logout {
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  height: 100vh;
}

.wrap { max-width: 1000px; margin: 0 auto; }

/* Cards & Containers */
.card { 
  background: var(--card-bg); 
  border: 1px solid var(--card-border); 
  border-radius: 24px; 
  padding: 30px; 
  margin: 20px 0; 
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4); 
}

.card.small { max-width: 500px; margin: 60px auto; }

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

/* Stats Grid */
.stats-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stats-grid > div {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stats-grid > div strong {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stats-grid > div span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* Typography */

h1 { margin: 0 0 20px 0; font-size: 32px; font-weight: 800; }
h2 { margin: 0 0 16px 0; font-size: 24px; font-weight: 700; }
p { color: var(--muted); line-height: 1.6; }

/* Forms */
label { display: block; color: var(--muted); margin: 14px 0 8px; font-weight: 600; font-size: 14px; }
input, textarea, select { 
  width: 100%; 
  border: 1px solid var(--card-border); 
  border-radius: 14px; 
  background: rgba(0,0,0,0.3); 
  color: var(--text); 
  padding: 14px 18px; 
  outline: none; 
  font-family: inherit;
  font-size: 15px;
  transition: 0.2s border;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
}

/* Buttons */
button, .btn { 
  display: inline-flex; 
  align-items: center;
  justify-content: center;
  background: var(--accent); 
  color: white; 
  border: 0; 
  padding: 12px 24px; 
  border-radius: 14px; 
  font-weight: 700; 
  font-size: 15px;
  cursor: pointer; 
  transition: 0.2s background, 0.2s transform;
  gap: 8px;
}
button:hover, .btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}
.btn-light { 
  background: rgba(255, 255, 255, 0.1); 
  border: 1px solid var(--card-border); 
}
.btn-light:hover { background: rgba(255, 255, 255, 0.15); }
.danger-btn { background: var(--danger); }
.danger-btn:hover { background: #DC2626; }

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: rgba(0,0,0,0.2);
}
table { width: 100%; border-collapse: collapse; }
th { 
  background: rgba(255,255,255,0.03); 
  text-align: left; 
  padding: 16px; 
  font-size: 13px; 
  text-transform: uppercase; 
  letter-spacing: 1px;
  color: var(--muted);
}
td { 
  padding: 16px; 
  border-top: 1px solid var(--card-border); 
  font-size: 15px;
  font-weight: 600;
}
tbody tr { transition: 0.2s background; }
tbody tr:hover { background: rgba(255,255,255,0.02); }

/* Dropdowns / Modals (Estilo Vizzion) */
.action-menu {
  position: relative;
  display: inline-block;
}
.action-btn {
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  padding: 4px 10px;
  border-radius: 8px;
}
.action-btn:hover { background: rgba(255,255,255,0.1); color: #fff; transform: none; }
.action-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  min-width: 180px;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  padding: 8px;
}
.action-menu:focus-within .action-dropdown,
.action-menu:hover .action-dropdown {
  display: flex;
  flex-direction: column;
}
.action-dropdown a, .action-dropdown button {
  text-align: left;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  background: transparent;
  width: 100%;
  border: none;
  justify-content: flex-start;
  margin: 0;
}
.action-dropdown a:hover, .action-dropdown button:hover {
  background: rgba(255,255,255,0.1);
}

/* Badges */
.badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
}
.badge-ok { background: rgba(16, 185, 129, 0.2); color: var(--ok); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-accent { background: rgba(37, 99, 235, 0.2); color: #60A5FA; border: 1px solid rgba(37, 99, 235, 0.3); }

/* Helpers */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.text-center { text-align: center; }
.mt-4 { margin-top: 20px; }
.mb-4 { margin-bottom: 20px; }

/* Activation specific */
.activation-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px;
}
.tv-icon {
  width: 120px;
  margin-bottom: 20px;
}

/* Floating WhatsApp (like in the screenshot) */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #25D366;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3);
  z-index: 1000;
  transition: 0.3s transform;
}
.whatsapp-float:hover {
  transform: scale(1.1);
}

/* ===== Online Agora Card ===== */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.online-now-card {
  border-color: rgba(16, 185, 129, 0.25);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.7), rgba(6, 38, 28, 0.4));
  position: relative;
  overflow: hidden;
}

.online-now-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #10B981, transparent);
  animation: live-pulse 2s ease-in-out infinite;
}

.online-now-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.live-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  animation: live-pulse 2s ease-in-out infinite;
}

.online-count-badge {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10B981;
  font-size: 20px;
  font-weight: 800;
  border-radius: 14px;
  padding: 8px 20px;
  min-width: 90px;
  text-align: center;
}

.online-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.online-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.1);
  transition: background 0.2s;
}

.online-item:hover {
  background: rgba(16, 185, 129, 0.1);
}

.online-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10B981;
  flex-shrink: 0;
  animation: pulse-dot 1.8s ease-in-out infinite;
}

.online-user {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.online-device {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  flex: 1;
}

.online-time {
  font-size: 12px;
  color: rgba(16, 185, 129, 0.8);
  font-weight: 600;
  white-space: nowrap;
}

.online-empty {
  text-align: center;
  padding: 20px 0;
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .grid { grid-template-columns: 1fr; }
  .online-now-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .online-device { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .main-content { padding: 20px 16px; }
  .card { padding: 20px; border-radius: 16px; }
  .stats-grid > div strong { font-size: 26px; }
}
