/* ====================================================================
   DISEÑO VISUAL PREMIUM (Glassmorphism & Neon Dark Mode) - 'MiBro'
   Estilos CSS de vanguardia para el Gestor de Credenciales
   ==================================================================== */

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

:root {
  /* Paleta de Colores HSL Premium */
  --bg-dark: 224deg 25% 6%;
  --bg-card: 224deg 20% 10%;
  --bg-card-hover: 224deg 20% 14%;
  --border-color: 224deg 20% 18%;
  
  --primary: 238deg 83% 66%;         /* Indigo Neón */
  --primary-glow: 238deg 83% 66% / 0.15;
  --secondary: 172deg 90% 43%;       /* Teal / Turquesa */
  --accent: 295deg 80% 60%;          /* Magenta / Orquídea */
  
  --text-main: 0deg 0% 95%;          /* Blanco suave */
  --text-muted: 220deg 10% 65%;      /* Gris azulado apagado */
  --text-highlight: 172deg 90% 43%;
  
  --success: 142deg 72% 43%;
  --warning: 38deg 92% 50%;
  --danger: 350deg 89% 60%;
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --glass-bg: rgba(13, 17, 28, 0.65);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  
  --sidebar-width: 280px;
}

/* ====================================================================
   1. Estilos Globales y Reset
   ==================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--border-color)) transparent;
}

body {
  font-family: var(--font-body);
  background-color: hsl(var(--bg-dark));
  color: hsl(var(--text-main));
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Orbes Decorativos de Fondo (Efecto de Luz) */
.glowing-orb {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(150px);
  z-index: -1;
  opacity: 0.25;
  pointer-events: none;
}

.orb-primary {
  background-color: hsl(var(--primary));
  top: -100px;
  right: -50px;
}

.orb-secondary {
  background-color: hsl(var(--accent));
  bottom: -100px;
  left: -50px;
}

/* ====================================================================
   2. Pantalla de Bloqueo (Master Password Setup)
   ==================================================================== */
.lock-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, hsl(224deg 25% 10%) 0%, hsl(var(--bg-dark)) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  padding: 20px;
}

.lock-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Pantallas de autenticación dentro de la tarjeta (login, registro, desbloqueo,
   recuperación, reset): ocultar de verdad las que tengan la clase .hidden.
   Sin esto se mostraban todas apiladas a la vez. */
.lock-card .hidden {
  display: none !important;
}

.lock-card {
  width: 100%;
  max-width: 450px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--glass-shadow), 0 0 40px hsl(var(--primary-glow));
  text-align: center;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-logo-large {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--secondary)));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-family: var(--font-title);
  font-size: 24px;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.logo-text {
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #fff 30%, hsl(var(--text-muted)) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lock-title {
  font-family: var(--font-title);
  font-size: 20px;
  margin-bottom: 8px;
  color: #fff;
}

.lock-subtitle {
  font-size: 14px;
  color: hsl(var(--text-muted));
  margin-bottom: 30px;
  line-height: 1.5;
}

/* ====================================================================
   3. Elementos de Formulario Comunes
   ==================================================================== */
.input-group {
  margin-bottom: 20px;
  text-align: left;
}

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--text-muted));
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: hsl(var(--text-muted));
  pointer-events: none;
}

.form-control {
  width: 100%;
  padding: 14px 16px 14px 46px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 15px;
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: hsl(var(--primary));
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px hsl(var(--primary-glow));
}

/* Editor de Texto Enriquecido Premium (Contenteditable) */
#credNotes {
  display: block;
  min-height: 120px;
  max-height: 250px;
  overflow-y: auto;
  padding-left: 16px;
  padding-right: 16px;
  word-break: break-word;
  line-height: 1.6;
  white-space: normal;
}

#credNotes:empty::before {
  content: attr(placeholder);
  color: hsl(var(--text-muted));
  cursor: text;
  display: block;
}

.btn-toggle-pass {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  color: hsl(var(--text-muted));
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.btn-toggle-pass:hover {
  color: #fff;
}

.btn {
  width: 100%;
  padding: 14px 24px;
  border-radius: 12px;
  border: none;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary) / 0.8));
  color: white;
  box-shadow: 0 4px 12px hsl(var(--primary-glow));
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px hsl(var(--primary-glow)), 0 0 15px hsl(var(--primary) / 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ====================================================================
   4. Layout de Aplicación Principal (Dashboard)
   ==================================================================== */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Estilo Glassmorphism */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(10, 13, 22, 0.8);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
  padding-left: 8px;
}

.sidebar-section-title {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: hsl(var(--text-muted));
  margin-bottom: 12px;
  padding-left: 8px;
}

.sidebar-menu {
  list-style: none;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-item {
  width: 100%;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 10px;
  color: hsl(var(--text-muted));
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-fast);
  cursor: pointer;
}

.sidebar-link-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-link:hover, .sidebar-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
  background: hsl(var(--primary-glow));
  color: #fff;
  box-shadow: inset 3px 0 0 hsl(var(--primary));
}

.project-badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.project-count {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 8px;
  color: hsl(var(--text-muted));
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ====================================================================
   5. Contenedor Principal de Contenido
   ==================================================================== */
.main-content {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Barra Superior: Búsqueda y Botón Acción */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.search-container {
  max-width: 500px;
  width: 100%;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-control {
  width: 100%;
  padding: 14px 16px 14px 46px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  color: #fff;
  font-size: 15px;
  transition: var(--transition-smooth);
}

.search-control:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.04);
  border-color: hsl(var(--primary));
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

/* Seccional de Filtro de Tags Activos */
.filter-tags-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tag-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tag-filter-badge:hover, .tag-filter-badge.active {
  background: hsl(var(--secondary) / 0.1);
  border-color: hsl(var(--secondary));
  color: #fff;
}

.tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Dashboard Header */
.dashboard-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-title {
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.dashboard-subtitle {
  font-size: 15px;
  color: hsl(var(--text-muted));
}

/* ====================================================================
   6. Grid y Cards de Credenciales
   ==================================================================== */
.credentials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.cred-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.cred-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: hsl(var(--primary));
  opacity: 0;
  transition: var(--transition-fast);
}

.cred-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), 0 0 20px hsl(var(--primary-glow));
}

.cred-card:hover::before {
  opacity: 1;
}

.cred-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.cred-logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cred-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.cred-title-block {
  display: flex;
  flex-direction: column;
}

.cred-service-name {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.cred-project-name {
  font-size: 11px;
  color: hsl(var(--text-muted));
  display: flex;
  align-items: center;
  gap: 5px;
}

.cred-actions-menu {
  display: flex;
  gap: 6px;
}

.btn-card-action {
  background: none;
  border: none;
  color: hsl(var(--text-muted));
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: var(--transition-fast);
}

.btn-card-action:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.btn-card-action.danger:hover {
  color: hsl(var(--danger));
  background: hsl(var(--danger) / 0.1);
}

/* Credential Fields */
.cred-fields-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cred-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
}

.cred-field-label {
  color: hsl(var(--text-muted));
  font-weight: 500;
}

.cred-field-value {
  color: #fff;
  font-family: monospace;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cred-password-dots {
  letter-spacing: 2px;
  font-size: 14px;
}

.btn-copy {
  background: none;
  border: none;
  color: hsl(var(--text-muted));
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.btn-copy:hover {
  color: hsl(var(--secondary));
}

/* Tags de Credencial */
.cred-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.cred-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Nota rápida/apunte preview indicator */
.cred-notes-indicator {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: hsl(var(--primary));
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.cred-notes-indicator:hover {
  color: #fff;
}

/* ====================================================================
   7. Modales de Creación y Edición
   ==================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: hsl(var(--bg-card));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  width: 90%;
  max-width: 600px;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: var(--transition-smooth);
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

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

.modal-title {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 700;
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.04);
  border: none;
  color: hsl(var(--text-muted));
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-close-modal:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Modificadores y Estructuras de Formulario Internos */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tag-selector-wrapper {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.1);
  min-height: 48px;
}

.tag-checkbox-badge {
  position: relative;
  cursor: pointer;
}

.tag-checkbox-badge input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.tag-checkbox-label {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition-fast);
}

.tag-checkbox-badge input:checked + .tag-checkbox-label {
  background: hsl(var(--primary) / 0.15);
  border-color: hsl(var(--primary));
  color: white;
  box-shadow: 0 0 10px hsl(var(--primary-glow));
}

/* Generador de contraseña integrado */
.pass-gen-container {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.btn-gen-pass {
  flex: 1;
  padding: 10px;
  font-size: 12px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid hsl(var(--primary) / 0.3);
  color: hsl(var(--primary));
}

.btn-gen-pass:hover {
  background: hsl(var(--primary) / 0.2);
}

/* ====================================================================
   8. Sección de Notas de Parche / Ajustes Premium
   ==================================================================== */
.settings-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-section-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.patch-notes-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 10px;
}

.patch-version-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 18px;
}

.patch-version-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.patch-version-title {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 600;
  color: hsl(var(--secondary));
}

.patch-version-date {
  font-size: 12px;
  color: hsl(var(--text-muted));
}

.patch-version-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.1);
  color: hsl(var(--success));
  padding: 2px 6px;
  border-radius: 6px;
}

.patch-version-list {
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
  color: hsl(var(--text-muted));
}

/* ====================================================================
   9. Animaciones
   ==================================================================== */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Notificación Toast */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: hsl(var(--bg-card));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid hsl(var(--primary));
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  font-size: 14px;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition-smooth);
}

.toast-notification.active {
  transform: translateY(0);
  opacity: 1;
}

.toast-notification.success {
  border-left-color: hsl(var(--success));
}

.toast-notification.error {
  border-left-color: hsl(var(--danger));
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: hsl(var(--text-muted));
  gap: 15px;
}

.empty-state-icon {
  font-size: 48px;
  color: hsl(var(--primary-glow));
}

/* Botones y Overlay para Menú Móvil responsivo */
.btn-menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.btn-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-close-sidebar {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: none;
  color: hsl(var(--text-muted));
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  z-index: 101;
}

.btn-close-sidebar:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .app-container {
    flex-direction: row; /* Mantener horizontal en tablets y delegar el colapso al responsive */
  }
  .main-content {
    padding: 24px;
  }
}

@media (max-width: 768px) {
  .btn-menu-toggle {
    display: inline-flex;
  }
  
  .btn-close-sidebar {
    display: inline-flex;
  }
  
  /* Comportamiento de Sidebar como Drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 290px;
    height: 100vh;
    transform: translateX(-100%);
    transition: var(--transition-smooth);
    background: rgba(10, 13, 22, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.6);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  /* Ajuste Ultra-Limpio de la Barra Superior */
  .top-bar {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
  }
  
  .top-bar .btn-menu-toggle {
    grid-column: 1;
    grid-row: 1;
  }
  
  .top-bar .search-container {
    grid-column: 1 / span 2;
    grid-row: 2;
    max-width: 100%;
  }
  
  .top-bar > div:last-child {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
  }
  
  .top-bar > div:last-child .btn {
    padding: 10px 14px;
    font-size: 13px;
    height: 46px;
    width: auto;
  }

  /* Formulario Responsivo: 1 Columna en móviles */
  .form-row {
    grid-template-columns: 1fr;
    gap: 0px;
  }
  
  .form-row .input-group {
    margin-bottom: 16px;
  }

  /* Optimización de Rendimiento de Orbes (60FPS en Móvil) */
  .glowing-orb {
    width: 220px;
    height: 220px;
    filter: blur(70px);
    opacity: 0.12;
  }
  
  .orb-primary {
    top: -50px;
    right: -30px;
  }
  
  .orb-secondary {
    bottom: -50px;
    left: -30px;
  }
  
  /* Ajustes UX en modales para teléfonos */
  .modal-container {
    padding: 20px 16px;
    border-radius: 20px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
  }
  
  .pass-gen-container {
    flex-direction: column;
    gap: 6px;
  }
  
  .btn-gen-pass {
    padding: 8px;
    font-size: 11px;
    width: 100%;
    margin-top: 0;
  }
  
  .dashboard-title {
    font-size: 26px;
  }
  
  .dashboard-subtitle {
    font-size: 13px;
  }
  
  .credentials-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .lock-card {
    padding: 28px 20px;
  }
}
