:root {
  --bg-deep: #0f1419;
  --bg-card: #1a2332;
  --bg-input: #243044;
  --accent: #3d9cf5;
  --accent-soft: rgba(61, 156, 245, 0.15);
  --accent-warm: #f0a060;
  --text: #eef4fc;
  --text-muted: #8fa3bf;
  --border: rgba(255, 255, 255, 0.08);
  --success: #4ade80;
  --danger: #f87171;
  --radius: 16px;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html, body {
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
}

body {
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* Login layout — estilo Skynet (referencia visual) */
.login-skynet-page {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.login-skynet-bg {
  position: fixed;
  inset: 0;
  background: url('/img/login-skynet-bg.jpg') center center / cover no-repeat;
  z-index: 0;
}

.login-skynet-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 11, 20, 0.35) 0%, rgba(5, 11, 20, 0.72) 45%, rgba(5, 11, 20, 0.92) 100%);
  z-index: 1;
}

.login-skynet-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  max-width: 460px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-skynet-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-skynet-logo {
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(26, 140, 255, 0.35);
}

.login-skynet-brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.75rem;
}

.login-skynet-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: linear-gradient(90deg, #38bdf8, #1a8cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-skynet-subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: var(--text);
}

.login-skynet-tagline {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login-skynet-card {
  width: 100%;
  background: rgba(10, 22, 40, 0.82);
  border: 1px solid rgba(26, 140, 255, 0.22);
  border-radius: 18px;
  padding: 1.75rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.login-skynet-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.login-skynet-card .subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 0;
}

.login-skynet-divider {
  height: 1px;
  background: rgba(26, 140, 255, 0.25);
  margin: 1rem 0 1.25rem;
}

.login-input-wrap input {
  background: rgba(20, 31, 51, 0.95);
  border-color: rgba(26, 140, 255, 0.2);
}

.btn-login-skynet {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.95rem 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, #38bdf8, #1a8cff);
  border: none;
  box-shadow: 0 10px 28px rgba(26, 140, 255, 0.35);
}

.login-skynet-or {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.35rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.login-skynet-or::before,
.login-skynet-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(26, 140, 255, 0.22);
}

.login-skynet-features {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.login-feature-card {
  background: rgba(10, 22, 40, 0.72);
  border: 1px solid rgba(26, 140, 255, 0.16);
  border-radius: 14px;
  padding: 1rem 0.85rem;
  text-align: center;
}

.login-feature-icon {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.login-feature-card strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
}

.login-feature-card p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.login-skynet-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Login layout (legacy páginas) */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-hero {
  position: relative;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(145deg, #162032 0%, #0d1828 50%, #12243d 100%);
  overflow: hidden;
}

.login-hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(61, 156, 245, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.login-hero::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -5%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(240, 160, 96, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.brand {
  position: relative;
  z-index: 1;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 24px rgba(61, 156, 245, 0.35);
}

.brand-name {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-logo-img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(61, 156, 245, 0.25);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-company {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.hero-links {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.hero-links a { font-weight: 600; }

.brand-tagline {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 380px;
  margin-bottom: 2rem;
}

.hero-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.hero-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.hero-features .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg-deep);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}

.login-card h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.login-card .subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group input::placeholder {
  color: #5a7088;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: white;
  box-shadow: 0 4px 16px rgba(61, 156, 245, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(61, 156, 245, 0.45);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  display: none;
}

.alert.show { display: block; }
.alert-error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}

.login-footer {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Dashboard */
.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.sidebar .brand-logo {
  margin-bottom: 2rem;
}

.sidebar .brand-name { font-size: 1.25rem; }

.nav-menu {
  list-style: none;
  flex: 1;
}

.nav-menu li {
  margin-bottom: 0.35rem;
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  color: var(--text-muted);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-menu a:hover,
.nav-menu a.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.main-content {
  padding: 2rem;
  overflow-y: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.topbar h1 {
  font-size: 1.6rem;
  font-weight: 600;
}

.user-menu {
  position: relative;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.user-menu-toggle {
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.user-menu-toggle:hover,
.user-menu-toggle[aria-expanded="true"] {
  border-color: rgba(61, 156, 245, 0.45);
  background: rgba(61, 156, 245, 0.06);
}

.user-menu-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  min-width: 0;
}

.user-menu-name {
  font-size: 0.92rem;
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.user-menu-chevron {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.15rem;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0.45rem;
  z-index: 120;
}

.user-menu-header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0.85rem 0.65rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.35rem;
}

.user-menu-header strong {
  font-size: 0.95rem;
}

.user-menu-header span {
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
}

.user-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.user-menu-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.user-menu-item--danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.profile-panel {
  max-width: 640px;
}

.profile-form .form-group {
  margin-bottom: 1rem;
}

.form-hint {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.profile-password-block {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.profile-password-block h4 {
  margin-bottom: 0.35rem;
}

.profile-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.stat-card .label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 700;
}

.stat-card .value.online { color: var(--success); }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.panel-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.device-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.device-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg-input);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.device-info h4 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.device-info span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.status-badge {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.online {
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
}

.status-badge.offline {
  background: rgba(143, 163, 191, 0.15);
  color: var(--text-muted);
}

.status-badge.wipe-pending {
  background: rgba(251, 146, 60, 0.18);
  color: #fb923c;
}

.device-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.device-wipe-note {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #fb923c;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
  border: 1px solid #b91c1c;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.wipe-modal[hidden] {
  display: none !important;
}

.wipe-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.wipe-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.wipe-modal-card {
  position: relative;
  width: min(520px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.wipe-modal-card h3 {
  margin-bottom: 0.35rem;
}

.wipe-modal-device {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.wipe-modal-warning {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.wipe-modal-warning ul {
  margin: 0.5rem 0 0.5rem 1.1rem;
}

.wipe-confirm-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.wipe-confirm-input {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wipe-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.wipe-modal-error {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.pairing-box {
  text-align: center;
  padding: 2rem;
  background: var(--accent-soft);
  border-radius: 12px;
  border: 1px dashed rgba(61, 156, 245, 0.4);
}

.pairing-code {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  color: var(--accent);
  margin: 1rem 0;
}

.empty-state {
  text-align: center;
  padding: 2.5rem;
  color: var(--text-muted);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Registro / utilidades */
.login-page--single { grid-template-columns: 1fr; }
.login-panel--full { min-height: 100vh; }
.brand-logo--center { justify-content: center; margin-bottom: 1.5rem; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.btn-link { background: none; border: none; color: var(--accent); font-size: 0.85rem; cursor: pointer; margin-top: 0.35rem; padding: 0; }
.btn-sm { padding: 0.55rem 1rem !important; font-size: 0.85rem !important; width: auto !important; }
.btn-menu { display: none; background: var(--bg-card); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 0.5rem 0.75rem; font-size: 1.2rem; cursor: pointer; }

.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
.filter-chip { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font-size: 0.9rem; }
.filter-chip input { accent-color: var(--accent); width: 1rem; height: 1rem; }

.timeline { display: flex; flex-direction: column; gap: 0.75rem; }
.timeline-item { padding: 1rem 1.25rem; background: var(--bg-input); border-radius: 12px; border: 1px solid var(--border); }
.timeline-type { font-weight: 600; margin-bottom: 0.35rem; }
.timeline-body { font-size: 0.9rem; color: var(--text-muted); }
.timeline-device { color: var(--text); font-weight: 500; }
.timeline-thumb { max-width: 100%; width: 220px; border-radius: 10px; margin-top: 0.5rem; border: 1px solid var(--border); }

/* Reportes — vista futurista */
.reports-page .panel-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.panel-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.reports-count {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(61, 156, 245, 0.25);
}

.device-filter {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.device-filter label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.reports-select {
  width: 100%;
  max-width: 360px;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
}

.reports-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.reports-timeline-panel {
  position: relative;
  overflow: hidden;
}

.reports-timeline-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(61, 156, 245, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(240, 160, 96, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.timeline-futuristic {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tl-loader {
  width: 36px;
  height: 36px;
  margin: 0 auto 1rem;
  border: 2px solid rgba(61, 156, 245, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.tl-date-group {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 1.25rem 0 0.5rem 2.75rem;
  animation: tl-fade-in 0.45s ease both;
  animation-delay: var(--delay, 0ms);
}

.tl-date-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tl-date-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tl-event {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.75rem;
  animation: tl-slide-in 0.5s ease both;
  animation-delay: var(--delay, 0ms);
}

.tl-rail {
  display: flex;
  justify-content: center;
  position: relative;
}

.tl-rail::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: -0.5rem;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(61, 156, 245, 0.15) 100%);
  opacity: 0.5;
}

.tl-event:last-child .tl-rail::before {
  bottom: 50%;
}

.tl-node {
  width: 14px;
  height: 14px;
  margin-top: 1.35rem;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px rgba(61, 156, 245, 0.55);
  position: relative;
  z-index: 1;
}

.tl-card {
  background: linear-gradient(135deg, rgba(36, 48, 68, 0.9) 0%, rgba(26, 35, 50, 0.95) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.tl-card:hover {
  border-color: rgba(61, 156, 245, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(61, 156, 245, 0.08);
  transform: translateY(-1px);
}

.tl-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.tl-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(61, 156, 245, 0.3);
  color: var(--text);
}

.tl-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  font-variant-numeric: tabular-nums;
}

.tl-time-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tl-time-hour {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  font-family: 'Consolas', 'SF Mono', ui-monospace, monospace;
  letter-spacing: 0.03em;
}

.tl-device {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.65rem;
}

.tl-device-icon { opacity: 0.85; }

.tl-details {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(15, 20, 25, 0.45);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.tl-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
}

.tl-detail-key {
  color: var(--text-muted);
  flex-shrink: 0;
}

.tl-detail-val {
  color: var(--text);
  text-align: right;
  word-break: break-word;
}

.tl-map-link,
.tl-file-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.tl-thumb-btn {
  display: block;
  position: relative;
  width: 100%;
  max-width: 280px;
  margin-top: 0.35rem;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  border-radius: 12px;
  overflow: hidden;
}

.tl-thumb {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: transform 0.25s ease, filter 0.25s ease;
}

.tl-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(15, 20, 25, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 12px;
}

.tl-thumb-icon {
  font-size: 1.5rem;
  color: white;
}

.tl-thumb-hint {
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tl-thumb-btn:hover .tl-thumb {
  transform: scale(1.03);
  filter: brightness(0.85);
}

.tl-thumb-btn:hover .tl-thumb-overlay { opacity: 1; }

.tl-event--call_log .tl-node { border-color: #4ade80; box-shadow: 0 0 12px rgba(74, 222, 128, 0.45); }
.tl-event--call_log .tl-badge { background: rgba(74, 222, 128, 0.12); border-color: rgba(74, 222, 128, 0.3); }
.tl-event--call_log .tl-time-hour { color: #4ade80; }

.tl-event--camera_front .tl-node { border-color: #c084fc; box-shadow: 0 0 12px rgba(192, 132, 252, 0.45); }
.tl-event--camera_front .tl-badge { background: rgba(192, 132, 252, 0.12); border-color: rgba(192, 132, 252, 0.3); }
.tl-event--camera_front .tl-time-hour { color: #c084fc; }

.tl-event--screenshot .tl-node { border-color: #f0a060; box-shadow: 0 0 12px rgba(240, 160, 96, 0.45); }
.tl-event--screenshot .tl-badge { background: rgba(240, 160, 96, 0.12); border-color: rgba(240, 160, 96, 0.3); }
.tl-event--screenshot .tl-time-hour { color: #f0a060; }

.tl-event--location .tl-node { border-color: #38bdf8; box-shadow: 0 0 12px rgba(56, 189, 248, 0.45); }
.tl-event--location .tl-badge { background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.3); }
.tl-event--location .tl-time-hour { color: #38bdf8; }

@keyframes tl-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tl-slide-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Lightbox */
body.lightbox-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.lightbox--open {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 18, 0.88);
  backdrop-filter: blur(12px);
}

.lightbox-stage {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 1100px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  transform: scale(0.94);
  transition: transform 0.22s ease;
}

.lightbox--open .lightbox-stage { transform: scale(1); }

.lightbox-close {
  position: absolute;
  top: -0.25rem;
  right: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.lightbox-close:hover {
  background: var(--bg-input);
  border-color: var(--accent);
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(90vh - 100px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.lightbox-meta {
  margin-top: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lightbox-type {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.lightbox-caption {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Guía, licencias, empresa */
.info-banner {
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(61, 156, 245, 0.28);
  font-size: 0.92rem;
  line-height: 1.55;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.guide-card { position: relative; }

.guide-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: white;
  margin-bottom: 0.85rem;
  box-shadow: 0 4px 14px rgba(61, 156, 245, 0.35);
}

.guide-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.guide-list.ordered { list-style: decimal; padding-left: 1.25rem; }
.guide-list.ordered li { color: var(--text-muted); }

.guide-perms li {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.perm-icon { flex-shrink: 0; }

.guide-note {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.legal-panel {
  border-color: rgba(240, 160, 96, 0.25);
  background: linear-gradient(135deg, rgba(36, 48, 68, 0.6), rgba(26, 35, 50, 0.85));
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.plan-card {
  position: relative;
  padding: 1.35rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.plan-card:hover,
.plan-card--selected {
  border-color: rgba(61, 156, 245, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.plan-card--featured {
  border-color: rgba(240, 160, 96, 0.45);
  background: linear-gradient(160deg, rgba(240, 160, 96, 0.08), rgba(36, 48, 68, 0.9));
}

.plan-card--selected { outline: 2px solid var(--accent); outline-offset: 2px; }

.plan-ribbon {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(240, 160, 96, 0.2);
  color: var(--accent-warm);
}

.plan-card h4 { margin-bottom: 0.5rem; font-size: 1.05rem; }

.plan-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}

.plan-price-alt {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  margin-bottom: 0.5rem;
}

.plan-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  min-height: 2.5rem;
}

.plan-features {
  list-style: none;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.plan-features li::before { content: '✓ '; color: var(--success); }

.paypal-area {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  max-width: 360px;
}

.license-status-badge {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  white-space: nowrap;
}

.license-status-badge--active {
  background: rgba(74, 222, 128, 0.12);
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.license-status-badge--inactive {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.license-alert { display: block; margin-bottom: 1rem; }

.faq-list { display: flex; flex-direction: column; gap: 0.65rem; }

.faq-item {
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
}

.faq-item p {
  margin-top: 0.65rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.public-page { min-height: 100vh; display: flex; flex-direction: column; }

.public-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.public-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.public-main {
  flex: 1;
  padding: 2rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.public-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.topbar--public { margin-bottom: 1.5rem; }

.company-hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

.company-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.company-lead {
  margin-top: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 620px;
}

.company-logo-large {
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.company-value-text { font-size: 1.35rem !important; }

.company-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.brand-logo--center { justify-content: center; }

/* Admin usuarios */
.admin-settings {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.admin-setting-note {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.admin-setting-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.admin-user-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-user-card {
  padding: 1.15rem 1.25rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-input);
}

.admin-user-card--admin {
  border-color: rgba(61, 156, 245, 0.35);
  background: linear-gradient(135deg, rgba(61, 156, 245, 0.08), rgba(36, 48, 68, 0.5));
}

.admin-user-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.admin-user-head h4 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.admin-user-email {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.admin-user-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.admin-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-left: 0.35rem;
}

.admin-perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.perm-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.35);
  cursor: pointer;
  font-size: 0.88rem;
}

.perm-toggle input {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.admin-grant-license {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}

.admin-grant-license .reports-select {
  max-width: 200px;
}

.admin-plan-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.admin-plan-card {
  padding: 1.15rem 1.25rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-plan-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.admin-plan-head h4 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.admin-plan-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.admin-plan-prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.admin-plan-prices--single {
  grid-template-columns: 1fr;
}

.admin-price-field--preview {
  gap: 0.45rem;
}

.admin-price-preview {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px dashed rgba(61, 156, 245, 0.35);
  background: rgba(61, 156, 245, 0.06);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

.admin-price-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.admin-price-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.35);
}

.admin-price-prefix {
  font-weight: 600;
  color: var(--text-muted);
}

.admin-price-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
}

.admin-price-input::-webkit-outer-spin-button,
.admin-price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.admin-plan-actions {
  margin-top: auto;
}

/* Responsive: móvil, tablet, iOS/Android navegadores */
@media (max-width: 900px) {
  .login-skynet-shell { padding-top: 1.75rem; }
  .login-skynet-features { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .dashboard { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(280px, 85vw); z-index: 100;
    transform: translateX(-100%); transition: transform 0.25s ease;
    box-shadow: var(--shadow);
  }
  .sidebar--open { transform: translateX(0); display: flex; }
  .btn-menu { display: inline-flex; }
  .topbar { gap: 0.75rem; flex-wrap: wrap; }
  .topbar h1 { font-size: 1.25rem; }
  .user-menu { width: 100%; }
  .user-menu-dropdown { left: 0; right: 0; min-width: 0; }
  .user-menu-name { max-width: 140px; }
  .login-card { padding: 1.75rem 1.25rem; }
  .main-content { padding: 1rem; padding-bottom: 2rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .device-item { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .device-actions { width: 100%; justify-content: space-between; }
  .pairing-code { font-size: 1.75rem; letter-spacing: 0.15em; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .timeline-thumb { width: 100%; max-width: 100%; }
  .tl-date-group { padding-left: 0; flex-direction: column; gap: 0.2rem; }
  .tl-event { grid-template-columns: 1.75rem 1fr; }
  .tl-card-head { flex-direction: column; align-items: flex-start; }
  .tl-time { align-items: flex-start; }
  .tl-thumb-btn { max-width: 100%; }
  .panel-actions { width: 100%; }
  .panel-header { flex-wrap: wrap; gap: 0.75rem; }
  .company-hero-grid { grid-template-columns: 1fr; }
  .public-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
  .public-main { padding: 1rem; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr; }
}

@supports (-webkit-touch-callout: none) {
  .form-group input { font-size: 16px; }
}