/* =========================================================
   RapidCV - Sistema de Diseño y Estilos Globales
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@400;600;700&family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;1,400&family=Roboto:wght@300;400;500;700&display=swap');

:root {
  --font-main: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --bg-app: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1f2937;
  --bg-surface-border: #374151;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  --accent-glow: rgba(59, 130, 246, 0.25);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-subtle: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-elevated: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Navbar */
.navbar {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-surface-border);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 0 15px var(--accent-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface-elevated);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--bg-surface-border);
  font-size: 0.875rem;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
}

.btn-gradient {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-gradient:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

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

.btn-secondary:hover {
  background: #283548;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.825rem;
  border-radius: var(--radius-sm);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

/* Contenedor principal */
.main-content {
  flex: 1;
  width: 100%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Alertas & Mensajes */
.messages-container {
  margin-bottom: 1.5rem;
}

.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.alert-error, .alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.alert-info {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

/* Tarjetas y Contenedores */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-surface-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-subtle);
}

.card-hover {
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card-hover:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-elevated);
}

/* Auth Card */
.auth-wrapper {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--bg-surface-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-elevated);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-notice-box {
  background: rgba(59, 130, 246, 0.08);
  border: 1px dashed rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: #93c5fd;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.auth-notice-box svg {
  flex-shrink: 0;
  margin-top: 2px;
}

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

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

.form-control {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--bg-surface-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Grid de CVs */
.cv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.cv-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.cv-preview-thumb {
  height: 160px;
  background: #1e293b;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--bg-surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: top center;
}

/* Contenedor de imagen nítida para plantilla */
.template-image-container {
  position: relative;
  width: 100%;
  height: 290px;
  background: #0f172a;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--bg-surface-border);
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.template-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.template-image-container:hover .template-preview-img {
  transform: scale(1.05);
}

.template-hover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 15, 25, 0.92) 0%, rgba(11, 15, 25, 0.6) 60%, rgba(11, 15, 25, 0.3) 100%);
  backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 1.25rem;
  text-align: center;
}

.template-image-container:hover .template-hover-overlay {
  opacity: 1;
}

.template-badge-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Modal Lightbox de Previsualización Nítida */
.preview-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 19, 0.88);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.preview-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.preview-modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--bg-surface-border);
  border-radius: var(--radius-xl);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.preview-modal-backdrop.active .preview-modal-dialog {
  transform: scale(1);
}

.preview-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--bg-surface-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface-elevated);
}

.preview-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex: 1;
}

.preview-modal-image-wrapper {
  flex: 1.2;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--bg-surface-border);
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  max-height: 70vh;
}

.preview-modal-image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.preview-modal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}


/* =========================================================
   CANVA-STYLE CV BUILDER & LIVE PREVIEW
   ========================================================= */

.editor-layout {
  display: grid;
  grid-template-columns: 320px 1fr 1fr;
  height: calc(100vh - 65px);
  overflow: hidden;
}

@media (max-width: 1200px) {
  .editor-layout {
    grid-template-columns: 300px 1fr;
    height: auto;
    overflow: visible;
  }
}

@media (max-width: 800px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
}

/* Panel 1: Canva Sidebar (Estilos, Colores, Cajas, Tipografía) */
.canva-sidebar {
  background: #111827;
  border-right: 1px solid var(--bg-surface-border);
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.color-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
}

/* Paleta de 16 colores fáciles */
.color-swatches-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 0.75rem;
}

.color-swatch-btn {
  width: 100%;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.color-swatch-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.color-swatch-btn.active {
  border-color: #ffffff;
  transform: scale(1.06);
  box-shadow: 0 0 0 2px var(--accent-primary);
}

.color-swatch-btn.active::after {
  content: '✓';
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.advanced-colors-container {
  display: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--bg-surface-border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-top: 0.75rem;
}

.advanced-colors-container.open {
  display: block;
}

/* Selector de fuentes por sección */
.section-fonts-container {
  display: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--bg-surface-border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.section-fonts-container.open {
  display: block;
}

/* =========================================================
   SISTEMA CANVA: EDICIÓN EN DIRECTO Y BLOQUES RELATIVOS
   ========================================================= */
.canva-live-active #cv-sheet {
  box-shadow: 0 0 0 2px #3b82f6, 0 20px 40px rgba(0, 0, 0, 0.45) !important;
}

.canva-movable {
  transition: transform 0.05s ease, box-shadow 0.15s ease, outline 0.15s ease;
  position: relative;
}

.canva-live-active .canva-movable {
  cursor: grab;
}

.canva-live-active .canva-movable:hover {
  outline: 1.5px dashed rgba(59, 130, 246, 0.75);
  outline-offset: 3px;
  border-radius: 4px;
}

.canva-live-active .canva-movable.is-dragging {
  cursor: grabbing !important;
  outline: 2px solid #2563eb !important;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35) !important;
  z-index: 100 !important;
  opacity: 0.95;
}

/* =========================================================
   EFECTO IMÁN Y ACOPLE AUTOMÁTICO (CANVA MAGNETIC SNAP)
   ========================================================= */
.canva-live-active .canva-magnet-target {
  outline: 2.5px dashed #06b6d4 !important;
  outline-offset: 4px !important;
  background-color: rgba(6, 182, 212, 0.08) !important;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.3) !important;
  transition: outline 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease !important;
}

.canva-live-active .is-magnet-snapped {
  outline: 2.5px solid #06b6d4 !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.5) !important;
}

.canva-snapped-bounce {
  animation: canvaSnapBounce 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes canvaSnapBounce {
  0% { transform: scale(1.05); }
  60% { transform: scale(0.97); }
  100% { transform: scale(1); }
}

.canva-snap-line {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  display: none;
}

.canva-snap-line-x {
  border-top: 2px dashed #06b6d4;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.8);
}

.canva-snap-line-y {
  border-left: 2px dashed #06b6d4;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.8);
}

#canva-magnet-badge {
  position: fixed;
  z-index: 100000;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(6px);
  color: #38bdf8;
  border: 1px solid #0284c7;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  gap: 5px;
  user-select: none;
}

.canva-handle {
  display: none;
  position: absolute;
  top: -12px;
  right: 6px;
  background: #2563eb;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  cursor: grab;
  z-index: 40;
  user-select: none;
  pointer-events: auto;
  line-height: 1.3;
}

.canva-handle:hover {
  background: #1d4ed8;
  transform: scale(1.05);
}

.canva-live-active .canva-movable:hover > .canva-handle,
.canva-live-active .canva-movable.is-dragging > .canva-handle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.canva-live-active [contenteditable="true"] {
  outline: 1px dashed rgba(59, 130, 246, 0.45);
  border-radius: 3px;
  transition: background-color 0.15s ease, outline 0.15s ease;
  cursor: text !important;
}

.canva-live-active [contenteditable="true"]:hover {
  outline: 1.5px dashed #3b82f6;
  background-color: rgba(59, 130, 246, 0.08);
}

.canva-live-active [contenteditable="true"]:focus {
  outline: 2px solid #2563eb !important;
  background-color: rgba(59, 130, 246, 0.12);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.color-input-badge {

  display: flex;
  align-items: center;
  gap: 0.5rem;
}

input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

/* Panel 2: Formulario de Contenido */
.content-panel {
  background: #0f172a;
  border-right: 1px solid var(--bg-surface-border);
  overflow-y: auto;
  padding: 1.5rem;
}

.section-accordion {
  background: var(--bg-surface);
  border: 1px solid var(--bg-surface-border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
}

.accordion-header {
  padding: 0.85rem 1.15rem;
  background: var(--bg-surface-elevated);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.accordion-body {
  padding: 1.25rem;
}

/* Panel 3: Lienzo Virtual A4 */
.preview-panel {
  background: #1e293b;
  overflow-y: auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sheet-a4 {
  width: 210mm;
  min-height: 297mm;
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  padding: 20mm 18mm;
  position: relative;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

@media (max-width: 900px) {
  .sheet-a4 {
    width: 100%;
    min-height: auto;
    padding: 1.5rem;
  }
}

/* Estilos dinámicos del CV dentro de la hoja A4 */
.cv-header {
  margin-bottom: 1.25rem;
}

.cv-name {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.cv-headline {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.cv-contact-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.65rem;
  font-size: 0.825rem;
  color: #64748b;
}

.cv-divider {
  height: 2px;
  width: 100%;
  margin: 1rem 0;
  opacity: 0.3;
}

.cv-section {
  margin-bottom: 1.25rem;
}

.cv-section-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cv-item {
  margin-bottom: 0.85rem;
}

.cv-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.cv-item-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.cv-item-company {
  font-weight: 600;
  font-size: 0.875rem;
}

.cv-item-date {
  font-size: 0.8rem;
  color: #64748b;
}

.cv-item-desc {
  font-size: 0.85rem;
  margin-top: 0.25rem;
  line-height: 1.5;
  color: #334155;
}

/* Cajas decorativas personalizadas */
.cv-box {
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}

.cv-box-card {
  border-radius: 8px;
}

.cv-box-bordered {
  border-left: 4px solid var(--cv-primary, #3b82f6);
  border-radius: 4px;
}

.cv-box-clean {
  border-bottom: 1px solid #e2e8f0;
  padding-left: 0;
  padding-right: 0;
}

.cv-box-glass {
  background: rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(203, 213, 225, 0.7) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
}

.cv-box-pill {
  border-radius: 999px !important;
  padding: 0.65rem 1.4rem !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.cv-box-gradient {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(238, 242, 255, 0.92) 100%) !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
}

.cv-box-shadow {
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.04) !important;
  border: 1px solid #f1f5f9 !important;
}

.cv-box-outline {
  border: 2px solid currentColor !important;
  background: transparent !important;
}

.canva-selected-element {
  outline: 2px solid #3b82f6 !important;
  outline-offset: 3px !important;
  border-radius: 4px;
}

.cropper-ratio-btn.active,
.cropper-shape-btn.active {
  background: var(--accent-primary) !important;
  color: #ffffff !important;
  border-color: var(--accent-primary) !important;
}

/* Barras de progreso de Habilidades */
.skill-bar-wrapper {
  margin-bottom: 0.5rem;
}

.skill-bar-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.skill-bar-track {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Badges / Chips de skills */
.skills-chips-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-chip {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: transform 0.15s ease;
}

/* Puntos de nivel (Dots 1 a 5) */
.skill-dots-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
}

.skill-dots-indicators {
  display: flex;
  gap: 5px;
  align-items: center;
}

.skill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.skill-dot-empty {
  background-color: #e2e8f0;
}

/* Layouts de plantilla */
.cv-layout-sidebar {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.cv-layout-single {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* =========================================================
   LAYOUT NOVOTECH (SIDEBAR LATERAL IZQUIERDA & TIMELINE)
   ========================================================= */
.cv-layout-novotech {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  min-height: 100%;
  margin: -20mm -18mm; /* Se expande por completo hasta los bordes de la hoja A4 */
}

.novotech-sidebar {
  background-color: #0a2540;
  color: #ffffff;
  padding: 24mm 16mm 20mm 16mm;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-sizing: border-box;
}

.novotech-main {
  background-color: #ffffff;
  color: #1e293b;
  padding: 20mm 20mm 20mm 20mm;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.novotech-sidebar-title {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  border-bottom: 2px solid rgba(56, 189, 248, 0.4);
  padding-bottom: 0.4rem;
  margin-bottom: 0.85rem;
}

.novotech-contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.novotech-icon-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.novotech-skill-bar {
  margin-bottom: 0.75rem;
}

.novotech-skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #f1f5f9;
}

.novotech-skill-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.novotech-skill-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* =========================================================
   SISTEMA DE LÍNEA DE TIEMPO CONECTADA (TIMELINE)
   ========================================================= */
.cv-timeline {
  position: relative;
  padding-left: 1.5rem;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.cv-timeline::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 8px;
  left: 6px;
  width: 2px;
  background: #cbd5e1;
}

.cv-timeline-item {
  position: relative;
}

.cv-timeline-dot {
  position: absolute;
  top: 5px;
  left: -1.5rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px #cbd5e1;
  z-index: 2;
}

.cv-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}

.cv-timeline-role {
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
}

.cv-timeline-period {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.cv-timeline-company {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}

.cv-timeline-desc {
  font-size: 0.85rem;
  line-height: 1.55;
  color: #334155;
  margin: 0;
  white-space: pre-line;
}

/* =========================================================
   LAYOUT EJECUTIVA ESMERALDA (ELIZA THORNTON)
   ========================================================= */
.cv-layout-ejecutiva {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ejecutiva-header {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #b45309;
}

.ejecutiva-avatar-frame {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 4px solid #064e3b;
  box-shadow: 0 0 0 3px #b45309;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0fdf4;
}

.ejecutiva-avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ejecutiva-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
  letter-spacing: 0.02em;
}

.ejecutiva-name-gold {
  color: #b45309;
}

.ejecutiva-name-green {
  color: #064e3b;
}

.ejecutiva-headline {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0.35rem 0 0.5rem 0;
}

.ejecutiva-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 1.25rem;
  font-size: 0.8rem;
  color: #334155;
  font-weight: 500;
}

.ejecutiva-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 1fr;
  gap: 1.5rem;
  align-items: start;
}

.ejecutiva-box {
  border: 2px solid #064e3b;
  border-radius: 12px;
  background: #fbfdfc;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-sizing: border-box;
}

.ejecutiva-box-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: #064e3b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.ejecutiva-role-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #b45309;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ejecutiva-company-line {
  font-size: 0.88rem;
  font-weight: 700;
  color: #064e3b;
  margin-bottom: 0.5rem;
}

.ejecutiva-exp-divider {
  border: none;
  height: 1px;
  background: #cbd5e1;
  margin: 0.85rem 0;
}

.ejecutiva-bullet {
  font-size: 0.85rem;
  line-height: 1.55;
  color: #1e293b;
  margin-bottom: 0.4rem;
  position: relative;
  padding-left: 1.2rem;
}

.ejecutiva-bullet::before {
  content: '●';
  position: absolute;
  left: 0;
  color: #064e3b;
  font-size: 0.75rem;
}

.ejecutiva-card {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.15rem;
  background: #ffffff;
}

.ejecutiva-card-header {
  background: #064e3b;
  color: #ffffff;
  padding: 0.5rem 0.85rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ejecutiva-card-body {
  padding: 0.85rem 1rem;
}

.ejecutiva-skill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.45rem;
}

.ejecutiva-skill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #064e3b;
  flex-shrink: 0;
}

/* =========================================================
   LAYOUT FLOWCLEAN MINIMALISTA ATS (ALEXANDRA CHEN)
   ========================================================= */
.cv-layout-flowclean {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.flowclean-header {
  margin-bottom: 0.5rem;
}

.flowclean-name {
  font-size: 2.3rem;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem 0;
}

.flowclean-meta-line {
  font-size: 0.85rem;
  color: #334155;
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.flowclean-meta-sep {
  color: #94a3b8;
  font-weight: 400;
}

.flowclean-section-title {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.65rem;
}

.flowclean-item {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.flowclean-item::before {
  content: '●';
  position: absolute;
  left: 0;
  top: 2px;
  color: #cbd5e1;
  font-size: 0.8rem;
}

.flowclean-item-header {
  font-weight: 800;
  font-size: 0.95rem;
  color: #0f172a;
  text-transform: uppercase;
}

.flowclean-item-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.flowclean-desc-bullet {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #334155;
  margin-bottom: 0.25rem;
}

.flowclean-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.flowclean-pill {
  background: #f1f5f9;
  color: #0f172a;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* =========================================================
   SISTEMA DE DISEÑO RESPONSIVO & MOBILE-FIRST
   ========================================================= */

/* Utilidades de visibilidad responsive */
.nav-text-mobile, .btn-text-mobile {
  display: none;
}
.nav-text-desktop, .btn-text-desktop {
  display: inline;
}
.mobile-only-action {
  display: none;
}

/* Fila de 2 columnas adaptable */
.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* Barra superior del Editor */
.editor-header-bar {
  background: #111827;
  border-bottom: 1px solid var(--bg-surface-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.editor-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 240px;
}

.editor-title-field {
  font-weight: 700;
  width: 280px;
  max-width: 100%;
  padding: 0.45rem 0.85rem;
}

.editor-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.save-status-badge {
  font-size: 0.78rem;
  color: #10b981;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.editor-btn-clean {
  border: 1px solid #10b981 !important;
  color: #10b981 !important;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}

.editor-btn-clean:hover {
  background: rgba(16, 185, 129, 0.15) !important;
}

/* Modal Cropper de Foto */
.cropper-button-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}

.cropper-controls-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.cropper-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--bg-surface-border);
  padding: 0.9rem 1.25rem;
  background: rgba(0, 0, 0, 0.2);
}

/* Dashboard & Galería Clases Base */
.dashboard-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.dashboard-hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cv-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--bg-surface-border);
  padding-top: 1rem;
}

.cv-card-actions .cv-btn-main {
  flex: 1;
}

.gallery-banner {
  background: radial-gradient(circle at top right, rgba(59,130,246,0.15), transparent 70%);
  border: 1px solid var(--bg-surface-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

.gallery-banner-title {
  font-size: 2.4rem;
  font-weight: 800;
  margin: 1rem 0 0.5rem;
  letter-spacing: -0.02em;
}

.sheet-scalable-container {
  transform-origin: top center;
  transition: transform 0.2s ease;
}

/* =========================================================
   MEDIA QUERY: TABLETS Y PANTALLAS MEDIANAS (<= 1024px)
   ========================================================= */
@media (max-width: 1024px) {
  /* Barra de pestañas móvil tipo App Móvil fija abajo */
  .mobile-tabs-bar {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    z-index: 9999 !important;
    background: rgba(17, 24, 39, 0.96) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-top: 1px solid var(--bg-surface-border) !important;
    border-bottom: none !important;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.55) !important;
    padding: 0.45rem 0.6rem calc(0.45rem + env(safe-area-inset-bottom, 0px)) 0.6rem !important;
    gap: 0.5rem !important;
  }

  .mobile-tab-btn {
    flex: 1;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    padding: 0.45rem 0.25rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: var(--text-muted) !important;
    min-height: 48px !important;
    cursor: pointer;
    transition: all 0.15s ease !important;
  }

  .mobile-tab-btn .tab-icon {
    font-size: 1.15rem !important;
    line-height: 1 !important;
  }

  .mobile-tab-btn.active {
    background: rgba(59, 130, 246, 0.16) !important;
    color: #60a5fa !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2) !important;
    font-weight: 700 !important;
  }

  .mobile-only-action {
    display: block !important;
  }

  .editor-layout {
    display: block !important;
    height: auto !important;
    min-height: calc(100vh - 120px) !important;
    overflow: visible !important;
  }

  /* Paneles independientes por pestaña */
  .editor-layout .canva-sidebar,
  .editor-layout .content-panel,
  .editor-layout .preview-panel {
    display: none !important;
    width: 100% !important;
    height: auto !important;
    overflow-y: visible !important;
    /* Espacio inferior de seguridad para que la barra fija no tape los botones */
    padding-bottom: calc(85px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .editor-layout.mobile-tab-content .content-panel {
    display: flex !important;
    flex-direction: column !important;
  }

  .editor-layout.mobile-tab-canva .canva-sidebar {
    display: flex !important;
    flex-direction: column !important;
  }

  .editor-layout.mobile-tab-preview .preview-panel {
    display: flex !important;
    flex-direction: column !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .sheet-wrapper-scalable {
    display: flex;
    justify-content: center;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2rem;
  }

  /* La hoja A4 mantiene dimensiones reales exactas para el transform: scale */
  .sheet-wrapper-scalable .sheet-a4 {
    width: 210mm !important;
    min-height: 297mm !important;
  }
}

/* =========================================================
   MEDIA QUERY: SMARTPHONES Y MÓVILES (<= 768px)
   ========================================================= */
@media (max-width: 768px) {
  /* Contenedores globales */
  .container {
    padding: 1rem 0.85rem !important;
  }

  /* Barra de navegación superior */
  .navbar {
    padding: 0.55rem 0.85rem !important;
    gap: 0.5rem !important;
  }

  .nav-brand {
    font-size: 1.15rem !important;
    gap: 0.45rem !important;
  }

  .brand-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.85rem !important;
  }

  .nav-links {
    gap: 0.4rem !important;
  }

  .nav-link {
    padding: 0.35rem 0.55rem !important;
    font-size: 0.82rem !important;
  }

  .user-pill {
    padding: 0.25rem 0.55rem !important;
    font-size: 0.78rem !important;
  }

  .user-avatar {
    width: 20px !important;
    height: 20px !important;
    font-size: 0.7rem !important;
  }

  /* Editor Header Bar */
  .editor-header-bar {
    padding: 0.55rem 0.75rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }

  .editor-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .editor-back-btn {
    flex-shrink: 0 !important;
    padding: 0.4rem 0.6rem !important;
    font-size: 0.8rem !important;
    min-height: 40px !important;
  }

  .editor-title-field {
    flex: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    font-size: 16px !important; /* Evita auto-zoom de iOS */
    padding: 0.45rem 0.65rem !important;
    min-height: 40px !important;
  }

  .editor-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 2px !important;
    flex-wrap: nowrap !important;
  }

  .editor-header-actions button,
  .editor-header-actions a {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    min-height: 38px !important;
    padding: 0.4rem 0.7rem !important;
    font-size: 0.8rem !important;
  }

  /* Modal de Previsualización en Galería */
  .preview-modal-dialog {
    max-height: 94vh !important;
    width: calc(100% - 1rem) !important;
    margin: 0.5rem auto !important;
    border-radius: var(--radius-lg) !important;
  }

  .preview-modal-body {
    flex-direction: column !important;
    padding: 1rem !important;
    gap: 1rem !important;
  }

  .preview-modal-image-wrapper {
    max-height: 45vh !important;
    width: 100% !important;
  }
}

/* =========================================================
   MEDIA QUERY: SMARTPHONES ESTRECHOS (<= 640px)
   ========================================================= */
@media (max-width: 640px) {
  /* Alternar etiquetas de texto para ahorrar espacio horizontal */
  .nav-text-desktop, .btn-text-desktop {
    display: none !important;
  }
  .nav-text-mobile, .btn-text-mobile {
    display: inline !important;
  }

  /* Formularios en móvil: tamaño amigable y sin zoom de iOS */
  .form-control,
  input[type="text"],
  input[type="password"],
  input[type="email"],
  select,
  textarea {
    font-size: 16px !important; /* Mínimo requerido por iOS Safari para no hacer zoom */
    min-height: 44px !important;
  }

  /* Filas de formularios a 1 columna */
  .form-row-2col {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  /* Acordeón del editor */
  .accordion-header {
    min-height: 48px !important;
    padding: 0.75rem 0.85rem !important;
    font-size: 0.92rem !important;
  }

  .accordion-body {
    padding: 0.85rem 0.65rem !important;
  }

  /* Cuadrícula de CVs en Home y Galería a 1 columna */
  .cv-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .cv-card-actions {
    gap: 0.4rem !important;
  }

  .cv-card-actions a,
  .cv-card-actions button {
    min-height: 40px !important;
  }

  /* Dashboard Header */
  .dashboard-hero-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1rem !important;
  }

  .dashboard-title {
    font-size: 1.5rem !important;
  }

  .dashboard-hero-actions {
    flex-direction: column !important;
    width: 100% !important;
  }

  .dashboard-action-btn {
    width: 100% !important;
    min-height: 44px !important;
  }

  /* Galería Banner */
  .gallery-banner {
    padding: 1.5rem 1rem !important;
    margin-bottom: 1.5rem !important;
    border-radius: var(--radius-lg) !important;
  }

  .gallery-banner-title {
    font-size: 1.6rem !important;
  }

  /* Cropper Modal */
  .cropper-button-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .cropper-controls-row {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .cropper-aux-btns {
    display: flex !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .cropper-aux-btns button {
    flex: 1 !important;
    min-height: 40px !important;
  }

  .cropper-footer {
    padding: 0.75rem 1rem !important;
  }

  .cropper-footer button {
    flex: 1 !important;
    min-height: 44px !important;
  }

  /* Previsualización Zoom Toolbar */
  .preview-zoom-toolbar button {
    min-height: 36px !important;
    padding: 4px 10px !important;
  }
}

/* =========================================================
   MEDIA QUERY: MÓVILES MUY PEQUEÑOS (<= 400px)
   ========================================================= */
@media (max-width: 400px) {
  .user-name-text {
    display: none !important;
  }

  .nav-brand span {
    font-size: 1.1rem !important;
  }

  .mobile-tab-btn {
    font-size: 0.7rem !important;
  }
}

/* =========================================================
   BURBUJA DE FOTO DE PERFIL (ESTILO REDES SOCIALES)
   ========================================================= */
.avatar-bubble-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s ease;
  overflow: hidden !important;
  box-sizing: border-box !important;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
  isolation: isolate;
  background-color: transparent;
}

.avatar-bubble-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  border-radius: inherit !important;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

.avatar-bubble-circle {
  border-radius: 50% !important;
  overflow: hidden !important;
}

.avatar-bubble-rounded {
  border-radius: 20% !important;
  overflow: hidden !important;
}

.avatar-bubble-squircle {
  border-radius: 36% !important;
  overflow: hidden !important;
}

.avatar-bubble-hexagon {
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  overflow: hidden !important;
}

.avatar-bubble-wrapper .canva-handle {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 10;
  font-size: 0.65rem;
  padding: 2px 6px;
  pointer-events: auto;
}

.avatar-shadow-none {
  box-shadow: none;
}

.avatar-shadow-subtle {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.avatar-shadow-glow {
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.4);
}

/* Paletas Armoniosas Smart Themes & Botones Rápidos */
.smart-theme-preset {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--bg-surface-border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  cursor: pointer;
}

.smart-theme-preset:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  transform: translateX(2px);
}

.btn-ratio-quick {
  transition: all 0.15s ease;
}

.btn-ratio-quick.btn-primary {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #1d4ed8 !important;
}

/* =========================================================
   REGLAS DE IMPRESIÓN (EXPORTAR A PDF NATIVO SIN MARCAS)
   ========================================================= */
@media print {
  @page {
    size: A4 portrait;
    margin: 0mm !important; /* Suprime la fecha, título y URL que añade el navegador */
  }

  html, body {
    background: #ffffff !important;
    color: #1e293b !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 210mm !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .navbar, .canva-sidebar, .content-panel, .editor-header-bar, .no-print, #print-frame {
    display: none !important;
  }

  .editor-layout, .preview-panel {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    overflow: visible !important;
    height: auto !important;
  }

  .sheet-a4 {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 16mm 16mm !important;
    width: 210mm !important;
    min-height: 297mm !important;
  }
}
