/* ── RESET & SISTEMA DE DISEÑO (AUGMENT AI SAAS THEME) ────────── */
:root {
  --bg-deep: #03140e;
  --bg-dark: #051d16;
  --panel-bg: rgba(6, 32, 23, 0.72);
  --panel-border: rgba(255, 255, 255, 0.1);
  --card-bg: rgba(9, 44, 32, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  
  --primary: #22c55e;
  --primary-hover: #16a34a;
  --primary-glow: rgba(34, 197, 94, 0.35);
  --lime: #a3e635;
  --lime-glow: rgba(163, 230, 53, 0.25);
  --emerald: #10b981;
  
  --text-main: #f0fdf4;
  --text-muted: #86efac;
  --text-sub: #94a3b8;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --info: #38bdf8;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  --shadow-panel: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ── MODO CLARO (LIGHT THEME - AUGMENT PEARL & EMERALD) ──────────── */
body.light-theme {
  --bg-deep: #f8faf8;
  --bg-dark: #f0fdf4;
  --panel-bg: rgba(255, 255, 255, 0.92);
  --panel-border: rgba(34, 197, 94, 0.22);
  --card-bg: rgba(240, 253, 244, 0.85);
  --card-border: rgba(34, 197, 94, 0.18);
  
  --text-main: #06281e;
  --text-muted: #15803d;
  --text-sub: #475569;
  
  --shadow-panel: 0 15px 40px rgba(6, 40, 30, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --shadow-card: 0 8px 24px rgba(6, 40, 30, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.2s ease;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  overflow-x: hidden;
  padding: 24px 0 60px 0;
}

/* ── AMBIENT MESH GLOW BACKGROUND (AUGMENT SAAS STYLE) ───────────── */
.background-glow {
  position: fixed;
  top: -15%;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  height: 650px;
  background: radial-gradient(ellipse at center, rgba(34, 197, 94, 0.22) 0%, rgba(163, 230, 53, 0.12) 35%, rgba(16, 185, 129, 0.05) 55%, rgba(3, 20, 14, 0) 75%);
  z-index: 0;
  pointer-events: none;
  filter: blur(40px);
}

body.light-theme .background-glow {
  background: radial-gradient(ellipse at center, rgba(34, 197, 94, 0.2) 0%, rgba(163, 230, 53, 0.14) 40%, rgba(248, 250, 248, 0) 75%);
}

.background-glow-secondary {
  position: fixed;
  bottom: -10%;
  right: -5%;
  width: 700px;
  height: 500px;
  background: radial-gradient(circle, rgba(163, 230, 53, 0.1) 0%, rgba(16, 185, 129, 0.04) 45%, rgba(3, 20, 14, 0) 70%);
  z-index: 0;
  pointer-events: none;
  filter: blur(50px);
}

body.light-theme .background-glow-secondary {
  background: radial-gradient(circle, rgba(163, 230, 53, 0.12) 0%, rgba(34, 197, 94, 0.06) 45%, rgba(248, 250, 248, 0) 70%);
}

/* ── APP DESKTOP CONTAINER (1380px) ──────────────────────────────── */
.app-container {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
}

/* ── VISTA DE AUTENTICACIÓN (LOGIN / REGISTER) ───────────────────── */
.auth-view {
  min-height: 85vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  padding: 38px;
  border-radius: var(--radius-xl);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.brand-logo {
  color: var(--primary);
  display: inline-flex;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px var(--primary-glow));
}

.auth-header h1 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff 40%, #86efac 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .auth-header h1 {
  background: linear-gradient(135deg, #06281e 40%, #15803d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-sub);
  font-size: 0.9rem;
}

.auth-tabs {
  display: flex;
  background: rgba(3, 20, 14, 0.7);
  padding: 4px;
  border-radius: var(--radius-full);
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.light-theme .auth-tabs {
  background: rgba(220, 252, 231, 0.6);
  border-color: rgba(34, 197, 94, 0.2);
}

.tab-btn {
  flex: 1;
  padding: 9px 16px;
  background: none;
  border: none;
  color: var(--text-sub);
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: var(--primary);
  color: #03140e;
  font-weight: 700;
  box-shadow: 0 2px 12px var(--primary-glow);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #cbd5e1;
}

body.light-theme .form-group label {
  color: #334155;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(4, 20, 14, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.92rem;
  outline: none;
  transition: all 0.2s ease;
}

body.light-theme .form-group input[type="email"],
body.light-theme .form-group input[type="password"],
body.light-theme .form-group input[type="text"],
body.light-theme .form-group input[type="url"],
body.light-theme .form-group select,
body.light-theme .form-group textarea {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: #06281e;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
  background: rgba(4, 20, 14, 0.85);
}

body.light-theme .form-group input:focus,
body.light-theme .form-group select:focus,
body.light-theme .form-group textarea:focus {
  background: #ffffff;
}

/* ── BOTONES GLOBALES ────────────────────────────────────────────── */
.btn {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #03140e;
  font-weight: 700;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover {
  background: #2ee06e;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
}

.btn-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #03140e;
  font-weight: 700;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-success:hover {
  background: linear-gradient(135deg, #2ee06e 0%, #22c55e 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(34, 197, 94, 0.5);
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}
.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

body.light-theme .btn-outline-light {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.15);
  color: #06281e;
}
body.light-theme .btn-outline-light:hover {
  background: rgba(0, 0, 0, 0.08);
}

.btn-outline-danger {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}
.btn-outline-danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-outline-success {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
}
.btn-outline-success:hover {
  background: var(--primary);
  color: #03140e;
}

body.light-theme .btn-outline-success {
  color: #15803d;
  border-color: #15803d;
}

.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; border-radius: var(--radius-sm); }

/* Theme Toggle Button */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  color: #fff;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.06);
}

body.light-theme .theme-toggle-btn {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
  color: #06281e;
}

/* Alertas */
.alert-box {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.alert-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

/* ── VISTA DEL DASHBOARD PRINCIPAL (DESKTOP) ─────────────────────── */
.dashboard-view {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Top Floating Pill Navigation Bar */
.topbar-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: rgba(6, 30, 22, 0.85);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(20px);
}

body.light-theme .topbar-pill {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(34, 197, 94, 0.2);
}

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

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #22c55e, #a3e635);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #03140e;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 0 12px var(--primary-glow);
}

.brand h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
}

body.light-theme .brand h2 {
  color: #06281e;
}

.brand h2 span {
  color: var(--lime);
}

body.light-theme .brand h2 span {
  color: #16a34a;
}

/* Segmented Pill Tabs Navigation */
.dashboard-nav-tabs {
  display: flex;
  gap: 6px;
  background: rgba(3, 18, 13, 0.8);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.light-theme .dashboard-nav-tabs {
  background: rgba(220, 252, 231, 0.6);
  border-color: rgba(34, 197, 94, 0.2);
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

body.light-theme .nav-tab-btn {
  color: #15803d;
}

.nav-tab-btn:hover {
  color: #fff;
}
body.light-theme .nav-tab-btn:hover {
  color: #06281e;
}

.nav-tab-btn.active {
  background: var(--primary);
  color: #03140e;
  font-weight: 700;
  box-shadow: 0 2px 10px var(--primary-glow);
}

/* User Profile Menu */
.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body.light-theme .user-info {
  background: rgba(220, 252, 231, 0.5);
  border-color: rgba(34, 197, 94, 0.2);
}

.user-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #f1f5f9;
}

body.light-theme .user-name {
  color: #06281e;
}

.plan-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.plan-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.plan-tag.starter { background: rgba(34, 197, 94, 0.18); color: #4ade80; }
.plan-tag.growth { background: rgba(56, 189, 248, 0.18); color: #38bdf8; }
.plan-tag.enterprise { background: rgba(168, 85, 247, 0.18); color: #c084fc; }

/* ── HERO BANNER & METRICS SECTION ───────────────────────────────── */
.hero-headline-box {
  padding: 10px 0 6px 0;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-full);
  color: var(--lime);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 12px;
}

body.light-theme .hero-pill-badge {
  color: #15803d;
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.25;
  color: #fff;
}

body.light-theme .hero-title {
  color: #06281e;
}

.hero-title span {
  background: linear-gradient(135deg, #a3e635 0%, #22c55e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .hero-title span {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.usage-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 24px;
  border-radius: var(--radius-lg);
}

@media (max-width: 960px) {
  .usage-summary {
    grid-template-columns: 1fr;
  }
}

.summary-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 20px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.summary-card:hover {
  border-color: rgba(34, 197, 94, 0.3);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.summary-title {
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body.light-theme .summary-title {
  color: #475569;
}

.summary-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
}

body.light-theme .summary-value {
  color: #06281e;
}

.summary-sub {
  font-size: 0.82rem;
  color: #86efac;
}

body.light-theme .summary-sub {
  color: #15803d;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .progress-bar {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.05);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #a3e635);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

/* ── CUADRÍCULA DE SLOTS Y CONEXIONES (DESKTOP) ─────────────────── */
.slots-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.section-title-bar h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

body.light-theme .section-title-bar h3 {
  color: #06281e;
}

.help-text {
  font-size: 0.86rem;
  color: #94a3b8;
}

body.light-theme .help-text {
  color: #475569;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 24px;
}

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

.slot-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-card);
}

.slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.light-theme .slot-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.slot-number {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--lime);
  text-transform: uppercase;
  letter-spacing: 1px;
}

body.light-theme .slot-number {
  color: #15803d;
}

.slot-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.slot-status-pill.connected { background: rgba(34, 197, 94, 0.18); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
body.light-theme .slot-status-pill.connected { color: #15803d; border-color: rgba(34, 197, 94, 0.4); }

.slot-status-pill.disconnected { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.slot-ghl-box {
  background: rgba(3, 18, 13, 0.6);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.light-theme .slot-ghl-box {
  background: rgba(240, 253, 244, 0.9);
  border-color: rgba(34, 197, 94, 0.2);
}

.box-label {
  font-size: 0.76rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 6px;
}

body.light-theme .box-label {
  color: #475569;
}

.box-value {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

body.light-theme .box-value {
  color: #06281e;
}

/* Tarjeta de Dispositivo dentro del Slot */
.device-item-card {
  background: rgba(4, 24, 17, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.light-theme .device-item-card {
  background: #ffffff;
  border-color: rgba(34, 197, 94, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.device-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.device-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

body.light-theme .device-title {
  color: #06281e;
}

.main-device-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #94a3b8;
  cursor: pointer;
}
.main-device-badge.active {
  color: var(--lime);
  font-weight: 700;
}
body.light-theme .main-device-badge.active {
  color: #15803d;
}
.main-device-badge input {
  display: none;
}

.device-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.device-field-group label {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

body.light-theme .device-field-group label {
  color: #475569;
}

.device-field-input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
}

body.light-theme .device-field-input {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.12);
  color: #06281e;
}

.connected-pill-green {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 12px;
}

body.light-theme .connected-pill-green {
  color: #15803d;
}

.config-settings-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}

body.light-theme .config-settings-box {
  background: rgba(240, 253, 244, 0.7);
  border-color: rgba(34, 197, 94, 0.15);
}

.config-settings-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--lime);
  margin-bottom: 8px;
}

body.light-theme .config-settings-title {
  color: #15803d;
}

.config-toggles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #cbd5e1;
}

body.light-theme .toggle-item {
  color: #334155;
}

/* Custom Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 18px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.18);
  transition: .3s;
  border-radius: 20px;
}

body.light-theme .slider {
  background-color: rgba(0, 0, 0, 0.15);
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}
input:checked + .slider:before {
  transform: translateX(18px);
}

/* ── SECCIÓN DE ENVÍOS MASIVOS (DESKTOP 2-COLUMN LAYOUT) ─────────── */
.broadcast-desktop-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr;
  gap: 28px;
  margin-top: 18px;
}

@media (max-width: 992px) {
  .broadcast-desktop-grid {
    grid-template-columns: 1fr;
  }
}

.broadcast-col-left, .broadcast-col-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.broadcast-toggle-pills {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  background: rgba(3, 18, 13, 0.5);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.light-theme .broadcast-toggle-pills {
  background: rgba(240, 253, 244, 0.8);
  border-color: rgba(34, 197, 94, 0.2);
}

.toggle-pill-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ── MODALES FLOTANTES ───────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  width: 100%;
  max-width: 480px;
  padding: 28px;
  border-radius: var(--radius-xl);
  position: relative;
  background: rgba(6, 32, 23, 0.95);
  border: 1px solid var(--panel-border);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

body.light-theme .modal-content {
  background: #ffffff;
  border-color: rgba(34, 197, 94, 0.3);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

body.light-theme .modal-header h3 {
  color: #06281e;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}
.close-btn:hover { color: #fff; }
body.light-theme .close-btn:hover { color: #06281e; }

.modal-desc {
  color: #94a3b8;
  font-size: 0.88rem;
  margin-bottom: 20px;
  line-height: 1.4;
}

body.light-theme .modal-desc {
  color: #475569;
}

.qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.qr-wrapper img {
  width: 220px;
  height: 220px;
  display: block;
}

.qr-instructions ol {
  padding-left: 20px;
  font-size: 0.85rem;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.light-theme .qr-instructions ol {
  color: #334155;
}

/* Spinner */
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(34, 197, 94, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
