.mobile-only {
  display: none !important;
}

/* ==========================================================================
   CrochetCraft Studio - Modern Cozy Craft Aesthetic
   ========================================================================== */

:root {
  /* Paleta Moderna Boutique: Blanco Puro, Negro Profundo & Fucsia Chic */
  --bg-main: #f8f9fa;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fdf2f8;
  
  --primary: #d90479; /* Fucsia / Magenta Chic */
  --primary-hover: #bc0367;
  --primary-light: #fdf2f8; /* Rosa suave */
  
  --secondary: #111827; /* Negro profundo / Carbón elegante */
  --secondary-hover: #000000;
  --secondary-light: #f3f4f6;
  
  --accent-gold: #f59e0b; /* Acento dorado */
  --accent-fuchsia: #e11d48;
  --accent-purple: #8b5cf6;
  
  --text-main: #111827; /* Negro carbón de alto contraste */
  --text-muted: #4b5563;
  --text-light: #9ca3af;
  
  --border-color: #e5e7eb; /* Bordes nítidos y modernos */
  --border-subtle: #f3f4f6;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(217, 4, 121, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-main);
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */

.app-container {
  display: flex;
  min-height: 100vh;
}

/* BARRA LATERAL (DRAWER DESLIZANTE QUE APARECE Y DESAPARECE) */
.sidebar {
  width: 290px;
  background: var(--bg-sidebar);
  border-right: 1.5px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 10000020;
  box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  transform: translateX(-105%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.sidebar.drawer-open {
  transform: translateX(0);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 10000015;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1.5px solid var(--border-subtle);
}

.brand-icon {
  font-size: 32px;
  background: white;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.brand-info h2 {
  font-size: 1.35rem;
  color: var(--primary);
  line-height: 1.1;
}

.brand-info span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--secondary);
  font-weight: 600;
}

/* WIDGET PROYECTO ACTIVO EN SIDEBAR */
.active-project-badge {
  margin: 18px 0;
  background: white;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--accent-gold);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.active-project-badge .badge-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.active-project-badge strong {
  font-size: 0.92rem;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--secondary);
  margin-top: 4px;
}

/* MENU NAVEGACIÓN */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  margin-top: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.nav-item i {
  font-size: 1.1rem;
  width: 22px;
  color: var(--accent-gold);
  transition: color var(--transition-fast);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--primary);
}

.nav-item.active {
  background: var(--primary);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(201, 106, 82, 0.25);
}

.nav-item.active i {
  color: white;
}

.sidebar-footer {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  border-top: 1.5px solid var(--border-subtle);
}

.btn-backup {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-backup:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* CONTENIDO PRINCIPAL */
.main-content {
  flex: 1;
  padding: 30px 40px;
  overflow-y: auto;
  max-width: 1400px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  gap: 20px;
}

.topbar-left h1 {
  font-size: 2rem;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.topbar-left p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 2px;
}

/* BOTONES */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(217, 4, 121, 0.28);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: var(--text-main);
  border: 1.5px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-success {
  background: #10b981;
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-warning {
  background: #e76f51;
  color: white;
}

.btn-warning:hover {
  background: #d85d3e;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  background: white;
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* ==========================================================================
   SUB-TABS MODULARES (SEGMENTED CONTROLS - CERO SCROLLING LARGO)
   ========================================================================== */

.modular-subtabs {
  display: flex;
  background: var(--bg-sidebar);
  padding: 4px;
  border-radius: var(--radius-full);
  gap: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.subtab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.subtab-btn i {
  font-size: 1rem;
}

.subtab-btn:hover {
  color: var(--primary);
}

.subtab-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.modular-subcontent {
  display: none !important;
}

.modular-subcontent.active,
.tab-content.active .modular-subcontent.active {
  display: block !important;
  animation: fadeIn 0.25s ease;
}

#subcontent-settings-tab-profile.active {
  display: flex !important;
  flex-direction: column;
  gap: 10px;
}

.tab-content:not(.active) .modular-subcontent {
  display: none !important;
}

/* ==========================================================================
   PARTES / PIEZAS DEL PROYECTO (CORONA NAVIDEÑA, AMIGURUMIS, ETC)
   ========================================================================== */

.project-parts-bar-wrapper {
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.parts-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.parts-progress-badge {
  background: #fdf6ee;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-gold);
}

.project-parts-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.part-chip {
  background: var(--bg-main);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.part-chip:hover {
  border-color: var(--primary);
  background: white;
}

.part-chip.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(201, 106, 82, 0.15);
}

.part-chip.completed {
  border-color: var(--secondary);
  background: var(--secondary-light);
  color: var(--secondary);
}

.part-chip-v {
  font-size: 0.75rem;
  background: white;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

/* CARDS */
.craft-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  position: relative;
  transition: all var(--transition-normal);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.card-header h3 {
  font-size: 1.25rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* DRAG AND DROP & ORDEN DE PIEZAS */
.project-card-part-chip.dragging,
.part-chip.dragging {
  opacity: 0.45 !important;
  transform: scale(0.98);
  border: 1.5px dashed var(--primary) !important;
  box-shadow: 0 8px 16px rgba(225, 29, 72, 0.15) !important;
}

.part-drag-handle {
  touch-action: none;
  cursor: grab;
  user-select: none;
  transition: transform 0.15s ease, color 0.15s ease;
}
.part-drag-handle:active {
  cursor: grabbing;
  transform: scale(1.2);
  color: var(--primary);
}

.btn-card-move-top,
.btn-timer-move-top {
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-card-move-top:hover,
.btn-timer-move-top:hover {
  background: #fce7f3 !important;
  border-color: #f472b6 !important;
  color: #be185d !important;
}
.btn-card-move-top:active,
.btn-timer-move-top:active {
  transform: scale(0.92);
}

/* TAB CONTENTS */
.tab-content {
  display: none !important;
}

.tab-content.active {
  display: block !important;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   1. DASHBOARD & PROYECTOS
   ========================================================================== */

.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: white;
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--primary);
}

.filter-pills {
  display: flex;
  gap: 8px;
}

.pill {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-color);
  background: white;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-color);
  background: white;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-filter-pill:hover {
  background: #fdf4ff;
  border-color: #f0abfc;
  color: #86198f;
}
.btn-filter-pill.active {
  background: linear-gradient(135deg, #c026d3, #9333ea);
  border-color: #c026d3;
  color: white;
  box-shadow: 0 2px 8px rgba(192, 38, 211, 0.25);
}

.supply-item-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.supply-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(192, 38, 211, 0.1);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

/* MODO PÁGINAS (DESPLAZAMIENTO TIPO LIBRO / REVISTA DE CROCHET - AUTOAJUSTABLE) */
.projects-grid.projects-pages-mode {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory !important;
  scroll-behavior: smooth !important;
  gap: 14px !important;
  padding: 4px 2px 8px 2px !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none; /* Ocultar barra fea en Firefox */
  align-items: flex-start !important; /* Autoajuste vertical estricto */
  width: 100% !important;
  box-sizing: border-box !important;
  transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.projects-grid.projects-pages-mode::-webkit-scrollbar {
  display: none; /* Ocultar barra en Chrome/Safari */
}

.projects-grid.projects-pages-mode .project-card {
  flex: 0 0 100% !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  scroll-snap-align: start !important;
  scroll-snap-stop: always !important;
  margin: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  align-self: flex-start !important; /* Se ajusta a su propio contenido */
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06) !important;
}

@media (min-width: 768px) {
  .projects-grid.projects-pages-mode {
    justify-content: flex-start !important;
  }
  .projects-grid.projects-pages-mode .project-card {
    flex: 0 0 620px !important;
    width: 620px !important;
    min-width: 620px !important;
    max-width: 620px !important;
    margin: 0 auto !important;
  }
}

.projects-pagination-nav {
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.projects-pagination-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.projects-pagination-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  padding: 0;
}

.projects-pagination-dot.active {
  background: var(--primary);
  width: 26px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.35);
}


.project-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-gold);
}

.project-card-image {
  height: 180px;
  background: #f7ede2;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card-placeholder {
  font-size: 3rem;
  color: var(--accent-gold);
}

.project-status-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.status-pending, .status-quote { background: #f3e8ff; color: #7e22ce; border: 1px solid #d8b4fe; }
.status-in_progress { background: #fef08a; color: #854d0e; }
.status-paused { background: #e2e8f0; color: #475569; }
.status-completed { background: #dcfce7; color: #166534; }

.project-card-body {
  padding: 18px 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-card-body h3 {
  font-size: 1.15rem;
  color: var(--text-main);
  line-height: 1.3;
}

.project-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-chip {
  font-size: 0.75rem;
  background: var(--bg-main);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
}

.project-progress-wrap {
  margin: 6px 0;
}

.project-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.progress-track {
  height: 8px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-rose), var(--primary));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.project-card-footer {
  padding: 12px 20px;
  background: var(--bg-main);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-time {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--secondary);
}

.footer-actions {
  display: flex;
  gap: 6px;
}

/* ==========================================================================
   2. CONTADOR Y TIMER MULTISESIÓN
   ========================================================================== */

.timer-view-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.timer-header-card {
  background: white;
  padding: 18px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.project-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  width: 100%;
}

.project-selector-wrapper .form-select {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.form-select {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: white;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
}

.timer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.timer-main-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timer-display {
  font-family: 'Outfit', monospace;
  font-size: 3.8rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 2px;
  margin: 12px 0;
  text-shadow: 0 2px 8px rgba(201, 106, 82, 0.15);
}

.timer-substats {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.timer-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.session-history {
  width: 100%;
  text-align: left;
  border-top: 1.5px solid var(--border-subtle);
  padding-top: 18px;
}

.session-history h4 {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.session-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.session-item strong {
  color: var(--secondary);
}

/* CONTADOR DE VUELTAS Y PUNTOS */
.counter-main-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.counter-block {
  background: var(--bg-main);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border-subtle);
}

.counter-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.big-counter-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 12px 0;
}

.counter-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 1.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.counter-btn.minus {
  background: white;
  color: var(--text-muted);
  border: 2px solid var(--border-color);
}

.counter-btn.minus:hover {
  background: #f1f5f9;
}

.counter-btn.plus {
  background: var(--primary);
  color: white;
}

.counter-btn.plus:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.counter-number {
  font-family: 'Outfit', sans-serif;
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--text-main);
  min-width: 80px;
}

.target-row-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.input-inline {
  width: 65px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  text-align: center;
  font-family: inherit;
  font-weight: 600;
}

.progress-bar-container {
  height: 6px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  margin-top: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--secondary);
  border-radius: var(--radius-full);
  transition: width 0.2s ease;
}

/* SUB CONTADORES */
.sub-counter {
  padding: 12px;
}

.medium-counter-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 6px 0;
}

.counter-btn.sm {
  width: 38px;
  height: 38px;
  font-size: 1.2rem;
}

.counter-number.sm {
  font-size: 1.8rem;
  min-width: 50px;
}

.repeat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
}

.repeat-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-note-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quick-note-box label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.quick-note-box input {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-family: inherit;
  font-size: 0.88rem;
}

/* ==========================================================================
   3. TEST DE VELOCIDAD Y ESTIMADOR
   ========================================================================== */

.estimator-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.speed-tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 20px 0;
}

.speed-test-box {
  background: var(--bg-main);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.test-icon {
  font-size: 2rem;
}

.test-timer {
  font-family: 'Outfit', monospace;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin: 6px 0;
}

.test-result {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--secondary);
}

.test-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.manual-speed-override {
  background: white;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 14px;
}

.manual-speed-override h4 {
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.manual-inputs-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}

.manual-inputs-row label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.manual-inputs-row input {
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.estimator-calc-card .estimator-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 10px;
}

.estimate-result-card {
  background: linear-gradient(135deg, #fdf8f5 0%, #f7ede2 100%);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.estimate-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.8px;
}

.estimate-big-time {
  font-family: 'Outfit', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.estimate-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.est-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-main);
  padding: 4px 0;
  border-bottom: 1px dashed var(--border-subtle);
}

.est-row.highlight {
  border: none;
  background: white;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.est-row.highlight strong {
  color: var(--secondary);
  font-size: 1.05rem;
}

/* ==========================================================================
   4. COTIZADOR DE COSTOS Y PRECIOS
   ========================================================================== */

.pricing-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

.quick-presets-section {
  background: var(--bg-main);
  border: 1.5px dashed var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.preset-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-preset {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-preset:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.section-divider-title {
  font-size: 1rem;
  color: var(--primary);
  margin: 18px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1.5px solid var(--border-subtle);
}

/* ==========================================================================
   TARJETAS DE MATERIALES E INSUMOS (ESTILO INVENTARIO / MÓVIL)
   ========================================================================== */

.pricing-materials-container {
  width: 100%;
}

.pricing-materials-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.pricing-mat-card {
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pricing-mat-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(201, 106, 82, 0.08);
}

.pricing-mat-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-mat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.pricing-mat-title-box {
  flex: 1;
  min-width: 0;
}

.pricing-mat-title-box input.mat-name {
  width: 100%;
  font-weight: 700;
  font-size: 0.96rem;
  padding: 8px 10px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  background: white;
}

.pricing-mat-title-box input.mat-name:focus {
  border-color: var(--primary);
  outline: none;
  background: #fffcfb;
}

.pricing-mat-body {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1.2fr;
  gap: 10px;
  align-items: center;
  background: var(--bg-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.pricing-mat-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pricing-mat-field label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pricing-mat-qty-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-qty-mini {
  width: 28px;
  height: 32px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.btn-qty-mini:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pricing-mat-qty-controls input.mat-qty {
  width: 55px;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 5px 2px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: white;
}

.pricing-mat-field input.mat-price {
  width: 100%;
  padding: 6px 8px;
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: white;
}

.pricing-mat-subtotal-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

.pricing-mat-subtotal-label {
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.pricing-mat-subtotal-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
}

@media (max-width: 520px) {
  .pricing-mat-body {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .pricing-mat-subtotal-box {
    grid-column: span 2;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--border-color);
    padding-top: 6px;
    margin-top: 2px;
  }
}

/* MODAL DE SELECCIÓN DE STOCK PARA COTIZADOR */
.stock-picker-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: all var(--transition-fast);
}

.stock-picker-item:hover {
  border-color: var(--primary);
  background: #fffafa;
}

.stock-picker-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stock-picker-swatch {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
/* ==========================================================================
   WIZARD MODULAR PASO A PASO DEL COTIZADOR (SECCIONES INDEPENDIENTES)
   ========================================================================== */

.pricing-stepper-wrapper {
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.pricing-stepper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pricing-stepper-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.pricing-step-pill {
  background: var(--bg-main);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.pricing-step-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: white;
}

.pricing-step-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(201, 106, 82, 0.22);
}

.pricing-step-pill.completed {
  background: #f0fdf4;
  color: #166534;
  border-color: #86efac;
}

.pricing-wizard-panel {
  display: none;
}

.pricing-wizard-panel.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

.wizard-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1.5px dashed var(--border-color);
  flex-wrap: wrap;
  gap: 10px;
}

/* RESUMEN CONSOLIDADO DE TODAS LAS SECCIONES */
.consolidated-summary-card {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.consolidated-section-box {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.consolidated-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border-color);
  color: var(--text-main);
}

.consolidated-row:last-child {
  border-bottom: none;
}

.consolidated-total-banner {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 2px solid #f97316;
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  margin: 16px 0;
}

.consolidated-big-price {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: #c2410c;
  margin: 4px 0;
}
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 10px;
}

.craft-table th {
  text-align: left;
  padding: 8px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1.5px solid var(--border-subtle);
}

.craft-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.craft-table input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
}

.subtotal-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  padding: 6px 0;
  color: var(--text-main);
}

.subtotal-row strong {
  color: var(--primary);
}

.price-quote-preview {
  background: white;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 20px;
}

.quote-header {
  border-bottom: 1.5px solid var(--border-subtle);
  padding-bottom: 14px;
}

.quote-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.quote-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.q-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.q-row.highlight-cost {
  border-top: 1.5px dashed var(--border-subtle);
  padding-top: 8px;
  color: var(--text-main);
  font-size: 0.95rem;
}

.quote-final-price {
  background: var(--bg-main);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  border: 1.5px solid var(--accent-gold);
}

.final-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
}

.big-price {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  margin: 4px 0;
}

.profit-label {
  font-size: 0.85rem;
  color: var(--secondary);
}

.quote-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* TARJETAS AMIGABLES DE HILOS, COLORES Y ACCESORIOS */
.yarn-color-card {
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: all var(--transition-fast);
}

.yarn-color-card:hover {
  border-color: var(--accent-gold);
}

.yarn-color-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--border-subtle);
  padding-bottom: 8px;
}

.yarn-color-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 8px;
  align-items: end;
}

.accessory-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 2.2fr 1.2fr auto;
  gap: 10px;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.02);
}

@media (max-width: 600px) {
  .yarn-color-card-grid {
    grid-template-columns: 1fr 1fr;
  }
  .yarn-color-card-grid .yarn-subtotal-col {
    grid-column: span 2;
  }
  .accessory-card {
    grid-template-columns: 1fr 1fr auto;
  }
}

/* HISTORIAL DE COTIZACIONES */
.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.quote-item-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.quote-item-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.quote-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.quote-item-header h4 {
  font-size: 1.05rem;
  color: var(--text-main);
  margin: 0;
  font-weight: 700;
}

.quote-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.quote-price-badge {
  background: var(--bg-main);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quote-price-badge .main-price {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--primary);
}

.quote-price-badge .deposit-price {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.quote-item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  margin-top: auto;
}

/* ==========================================================================
   5. INVENTARIO DE LANAS & OVILLOS
   ========================================================================== */

.inventory-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.inventory-actions {
  display: flex;
  gap: 10px;
}

.yarn-stash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.yarn-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
}

.yarn-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.yarn-swatch-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.yarn-color-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.yarn-title-info h4 {
  font-size: 1.05rem;
  color: var(--text-main);
  line-height: 1.2;
}

.yarn-title-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.yarn-stock-badge {
  background: var(--bg-main);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}

.yarn-stock-badge strong {
  color: var(--primary);
  font-size: 1.1rem;
}

.yarn-details-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
}

.yarn-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

/* ==========================================================================
   6. BITÁCORA DE PATRONES A OJO
   ========================================================================== */

.quick-stitch-keyboard {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 14px;
  background: var(--bg-main);
  border-radius: var(--radius-md);
}

.keyboard-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stitch-key {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: white;
  border: 1px solid var(--border-color);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.stitch-key:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pattern-editor-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .pattern-editor-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.creator-inputs {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .creator-inputs {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .creator-inputs input[type="text"],
  .creator-inputs input[type="number"],
  .creator-inputs button {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

.row-num-tag {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
  white-space: nowrap;
}

.creator-inputs input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  font-family: inherit;
}

.creator-inputs input[type="number"] {
  width: 90px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  text-align: center;
}

.pattern-rows-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.pattern-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-main);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}

.pattern-row-item strong {
  color: var(--primary);
}

.pattern-row-item .stitch-count-badge {
  background: white;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--secondary);
  border: 1px solid var(--border-color);
}

.pattern-preview-box {
  background: white;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pattern-preview-content {
  font-family: monospace;
  font-size: 0.88rem;
  background: var(--bg-main);
  padding: 16px;
  border-radius: var(--radius-md);
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.6;
}

/* ==========================================================================
   7. DISEÑADOR VISUAL
   ========================================================================== */

.visual-designer-container .designer-mode-selector {
  display: flex;
  gap: 8px;
}

.mode-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: white;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.mode-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.designer-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px 0;
  padding: 12px 18px;
  background: var(--bg-main);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.tool-group input {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.canvas-viewport {
  background: #fdfaf6;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  min-height: 450px;
}

#patternCanvas {
  background: white;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
  cursor: crosshair;
}

/* ==========================================================================
   MODALES Y FORMULARIOS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(17, 24, 39, 0.65);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000005;
  padding: 12px 10px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  max-height: 92vh;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

/* AJUSTES RESPONSIVOS ESTRICTAMENTE VERTICALES PARA CELULARES */
#modalAppSettings .modal-card,
#modalAddNewPartDialog .modal-card,
#modalManualTimeEntry .modal-card,
#modalTransferCenter .modal-card,
#modalManageSupplyDetail .modal-card,
#modalManageAccessoryDetail .modal-card,
#modalProjectCostBreakdown .modal-card,
#modalProjectWhatsAppUpdate .modal-card,
#modalProjectCareCard .modal-card,
#modalSalesRecord .modal-card,
#importAccessoriesModal .modal-card,
#importInventoryModal .modal-card {
  width: calc(100vw - 16px) !important;
  max-width: 480px !important;
  max-height: 88vh !important;
  margin: auto !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

#modalAppSettings .modal-body,
#modalAddNewPartDialog .modal-body,
#modalManualTimeEntry .modal-body,
#modalTransferCenter .modal-body,
#modalManageSupplyDetail .modal-body,
#modalManageAccessoryDetail .modal-body,
#modalProjectWhatsAppUpdate .modal-body,
#modalProjectCareCard .modal-body,
#modalSalesRecord .modal-body,
#importAccessoriesModal .modal-body,
#importInventoryModal .modal-body {
  padding: 14px 16px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

#modalProjectCostBreakdown .modal-body {
  padding: 10px 14px 6px 14px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

#modalManageSupplyDetail .modal-footer,
#modalManageAccessoryDetail .modal-footer,
#modalProjectCostBreakdown .modal-footer,
#modalProjectWhatsAppUpdate .modal-footer,
#modalProjectCareCard .modal-footer {
  flex-shrink: 0 !important;
  position: sticky !important;
  bottom: 0 !important;
  background: #ffffff !important;
  border-top: 1.5px solid var(--border-color) !important;
  padding: 10px 16px !important;
  z-index: 10 !important;
}

/* TABS Y PÁGINAS HORIZONTALES EN EL MODAL DE DESGLOSE DE COSTOS (SCROLL-SNAP TIPO REVISTA) */
.cost-breakdown-tabs {
  display: flex !important;
  gap: 6px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 4px 2px 8px 2px !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  border-bottom: 1.5px solid #e2e8f0 !important;
  margin-bottom: 6px !important;
  flex-shrink: 0 !important;
}
.cost-breakdown-tabs::-webkit-scrollbar {
  display: none !important;
}
.cost-breakdown-tab-btn {
  flex: 0 0 auto !important;
  font-size: 0.73rem !important;
  font-weight: 750 !important;
  padding: 5px 10px !important;
  border-radius: 20px !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #475569 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}
.cost-breakdown-tab-btn:hover {
  background: #f1f5f9 !important;
  color: #1e293b !important;
}
.cost-breakdown-tab-btn.active {
  background: #166534 !important;
  color: #ffffff !important;
  border-color: #166534 !important;
  box-shadow: 0 2px 6px rgba(22, 101, 52, 0.25) !important;
}

.cost-breakdown-tab-panels {
  width: 100% !important;
  box-sizing: border-box !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  padding-right: 2px !important;
}

.cost-breakdown-panel {
  display: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
  flex-direction: column !important;
  gap: 10px !important;
  animation: fadeInCostPanel 0.18s ease-in-out !important;
}

.cost-breakdown-panel.active {
  display: flex !important;
}

@keyframes fadeInCostPanel {
  from {
    opacity: 0.5;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* RENGLONES INTERACTIVOS EN LA TARJETA RESUMEN CONSOLIDADO */
.cost-summary-interactive-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  font-size: 0.8rem !important;
  padding: 5px 8px !important;
  margin: 1px 0 !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
  color: rgba(255, 255, 255, 0.95) !important;
}
.cost-summary-interactive-row:hover,
.cost-summary-interactive-row:active {
  background: rgba(255, 255, 255, 0.14) !important;
  transform: translateX(2px) !important;
}
.cost-summary-arrow {
  color: #93c5fd !important;
  font-weight: 800 !important;
  font-size: 0.95rem !important;
  opacity: 0.85 !important;
  margin-left: 2px !important;
}

/* MODAL DE IMPORTACIÓN INVENTARIO: SCROLL Y FOOTER FIJO EN MÓVILES */
#importInventoryModal .modal-card {
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#importInventoryModal .modal-body {
  overflow-y: auto !important;
  flex: 1 1 auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 14px 16px !important;
}

#importInventoryModal .modal-footer {
  flex-shrink: 0 !important;
  position: sticky !important;
  bottom: 0 !important;
  background: #ffffff !important;
  border-top: 1.5px solid var(--border-color) !important;
  padding: 10px 16px !important;
  z-index: 10 !important;
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1.5px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3 {
  font-size: 1.25rem;
  color: var(--primary);
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

/* LISTA DE COMPRAS */
.shopping-add-box {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.shopping-add-box input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
}

.shopping-items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 350px;
  overflow-y: auto;
}

.shopping-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-main);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
}

.shopping-item.checked {
  text-decoration: line-through;
  opacity: 0.6;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .timer-grid,
  .estimator-calc-card .estimator-form-grid,
  .pricing-grid,
  .pattern-editor-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SINCRONIZACIÓN Y PERFIL GOOGLE EN SIDEBAR
   ========================================================================== */

.sync-account-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 1.5px solid var(--border-color);
}

.profile-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.profile-details strong {
  font-size: 0.88rem;
  color: var(--text-main);
}

.sync-status-text {
  font-size: 0.74rem;
  color: var(--secondary);
  font-weight: 600;
  margin-top: 2px;
}

.btn-google-sync {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-google-sync:hover {
  background: white;
  border-color: #ea4335;
  color: #ea4335;
}

/* ==========================================================================
   GENERADOR DE PATRONES POR FORMA
   ========================================================================== */

.generator-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  margin-top: 10px;
}

.shape-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.shape-card {
  background: var(--bg-main);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.shape-card input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.shape-icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.shape-card strong {
  font-size: 0.85rem;
  color: var(--text-main);
}

.shape-card small {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 2px;
}

.shape-card.active, .shape-card:hover {
  border-color: var(--primary);
  background: white;
  box-shadow: var(--shadow-sm);
}

.generator-result-box {
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid var(--border-subtle);
  padding-bottom: 10px;
}

.result-header h4 {
  font-size: 1.05rem;
  color: var(--primary);
}

.result-actions {
  display: flex;
  gap: 8px;
}

.generated-pattern-text {
  font-family: monospace;
  font-size: 0.88rem;
  background: var(--bg-main);
  border-radius: var(--radius-md);
  padding: 16px;
  white-space: pre-wrap;
  line-height: 1.6;
  max-height: 380px;
  overflow-y: auto;
}

/* ==========================================================================
   TARJETA PARA COMPARTIR EN REDES
   ========================================================================== */

.share-card-canvas {
  background: linear-gradient(135deg, #fdf8f5 0%, #f7ede2 100%);
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-md);
}

.share-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1.5px;
}

.share-card-img {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.share-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.share-card-stats {
  display: flex;
  justify-content: space-around;
  background: white;
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  border: 1px solid var(--border-subtle);
}

.share-card-watermark {
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
}

/* ==========================================================================
   PAÍS / MONEDA Y TARIFAS DE REFERENCIA
   ========================================================================== */

.country-currency-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  font-size: 0.82rem;
  font-weight: 600;
}

.form-select-sm {
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 700;
  color: var(--primary);
  outline: none;
  cursor: pointer;
  font-size: 0.88rem;
}

.country-rate-hint-box {
  background: #fdf6ee;
  border: 1px solid var(--accent-gold);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   DIRECTORIO DE CLIENTES
   ========================================================================== */

.clients-directory-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
}

.client-directory-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.client-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.client-city-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 6px;
}

.client-phone-row {
  font-size: 0.82rem;
  color: var(--secondary);
  font-weight: 600;
}

.client-notes-box {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-main);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

/* ==========================================================================
   BARRA DE NAVEGACIÓN INFERIOR MÓVIL (NATIVE BOTTOM BAR)
   ========================================================================== */

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 62px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  border-top: 1.5px solid var(--border-color);
  z-index: 999999;
  justify-content: flex-start;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  padding: 0 6px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  touch-action: manipulation;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.mobile-bottom-nav::-webkit-scrollbar {
  display: none;
}

.m-nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #64748b;
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
  min-width: 64px;
  height: 100%;
  padding: 6px 8px;
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  border-radius: 8px;
}

.m-nav-item * {
  pointer-events: none;
}

.m-nav-item i {
  font-size: 1.25rem;
  transition: transform 0.18s ease, color 0.18s ease;
}

.m-nav-item:hover, .m-nav-item:active {
  color: var(--primary);
  background: rgba(201, 106, 82, 0.05);
}

.m-nav-item.active {
  color: var(--primary);
  font-weight: 850;
  background: rgba(201, 106, 82, 0.08);
  border-bottom: 2.5px solid var(--primary);
}

.m-nav-item.active i {
  transform: translateY(-2px) scale(1.1);
  color: var(--primary);
}

.nav-item * {
  pointer-events: none;
}

.mobile-brand-bar {
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.mobile-brand-bar .m-icon {
  font-size: 1.5rem;
}

.mobile-brand-bar .m-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MÓVIL 100% ADAPTADO)
   ========================================================================== */

@media (max-width: 1024px) {
  .generator-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
    padding-bottom: 74px; /* Espacio para la barra inferior */
  }

  /* En móvil la barra lateral es un Drawer deslizante y la barra inferior también está disponible */
  .sidebar {
    display: flex;
  }

  .mobile-bottom-nav {
    display: flex !important;
  }

  .mobile-brand-bar {
    display: flex;
  }

  .main-content {
    padding: 14px 12px;
    max-width: 100vw;
    padding-bottom: 78px !important;
  }

  .topbar {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
    padding: 10px 12px !important;
  }

  .topbar-right {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    width: auto !important;
    flex-shrink: 0 !important;
  }

  .country-currency-picker {
    justify-content: space-between;
  }

  .timer-grid,
  .estimator-calc-card .estimator-form-grid,
  .pricing-grid,
  .pattern-editor-grid {
    grid-template-columns: 1fr;
  }

  .big-price {
    font-size: 2rem;
  }

  .timer-display {
    font-size: 2.8rem;
  }

  .counter-number {
    font-size: 2.5rem;
  }

  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .modal-backdrop {
    padding: 10px 8px;
  }

  .modal-card {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-md);
    max-height: 94vh;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-header h3 {
    font-size: 1.15rem;
  }

  .modal-body {
    padding: 14px 12px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 9px 12px;
    font-size: 0.9rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .materials-craft-card {
    padding: 12px 10px !important;
  }

  .yarn-color-card {
    padding: 10px 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .yarn-color-card-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .accessory-card {
    grid-template-columns: 1fr 90px auto;
    padding: 8px 10px;
    gap: 6px;
    width: 100%;
  }
}

/* Accesorios Chips de Marcado Rápido */
.preset-accessory-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-chip {
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 5px 11px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.preset-chip:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
}

.preset-chip:active {
  transform: scale(0.95);
}

.preset-chip.is-selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(217, 4, 121, 0.25);
}

/* Indicadores de Stock en Materiales y Colores */
.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  margin-top: 4px;
  line-height: 1.2;
}

.stock-badge-in {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.stock-badge-low {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.stock-badge-out {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.btn-add-to-shopping {
  background: #fdf0ed;
  color: var(--primary);
  border: 1px solid var(--primary-light);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  transition: all 0.2s ease;
  vertical-align: middle;
}

.btn-add-to-shopping:hover {
  background: var(--primary);
  color: white;
}

/* ==========================================================================
   COTIZADOR MODULAR TIPO WIZARD (PASO A PASO) & RESUMEN CONSOLIDADO
   ========================================================================== */

.pricing-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
}

/* BARRA STEPPER DE NAVEGACIÓN ENTRE PASOS */
.pricing-stepper-wrapper {
  background: #ffffff;
  border: 1.5px solid #ebdcd5;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: 0 4px 16px rgba(180, 80, 50, 0.05);
  margin-bottom: 8px;
  transition: all var(--transition-fast);
}

.pricing-stepper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.pricing-stepper-header span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
}

.pricing-stepper-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 6px 0;
}

.pricing-stepper-pills::-webkit-scrollbar {
  display: none;
}

.pricing-step-pill {
  flex: 1;
  min-width: 120px;
  background: #fdfaf8;
  border: 1.5px solid #ebdcd5;
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.pricing-step-pill:hover {
  background: #ffffff;
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.pricing-step-pill.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(217, 4, 121, 0.25);
  transform: scale(1.02);
}

.pricing-step-pill.completed {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

.pricing-step-pill.completed::after {
  content: " ✓";
  font-weight: 800;
  color: #10b981;
}

/* PANELES DEL WIZARD (OCULTOS POR DEFECTO, SOLO UNO ACTIVO) */
.pricing-wizard-panel {
  display: none !important;
}

.pricing-wizard-panel.active {
  display: block !important;
  animation: wizardPanelSlide 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes wizardPanelSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* BOTONES DEL FOOTER DEL WIZARD */
.wizard-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1.5px dashed #f0ded7;
  gap: 10px;
  flex-wrap: wrap;
}

/* PRESETS RÁPIDOS */
.quick-presets-section {
  background: #fcf6f3;
  border: 1px solid #ebdcd5;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.preset-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-preset {
  background: #ffffff;
  border: 1px solid #e2cec5;
  border-radius: var(--radius-full);
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-preset:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* TARJETAS DE MATERIALES TÁCTILES */
.pricing-materials-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pricing-mat-card {
  background: #ffffff;
  border: 1.5px solid #ebdcd5;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.pricing-mat-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 4px 12px rgba(217, 4, 121, 0.08);
}

.pricing-mat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pricing-mat-icon {
  font-size: 1.3rem;
  width: 36px;
  height: 36px;
  background: #fbf4f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pricing-mat-title-box {
  flex: 1;
}

.pricing-mat-title-box input {
  width: 100%;
  font-size: 0.92rem;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  background: transparent;
  color: var(--text-main);
}

.pricing-mat-title-box input:focus {
  background: white;
  border-color: var(--primary);
  outline: none;
}

.pricing-mat-body {
  display: grid;
  grid-template-columns: 140px 150px 1fr;
  gap: 12px;
  align-items: center;
  background: #faf6f3;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.pricing-mat-field label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.pricing-mat-qty-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-qty-mini {
  width: 28px;
  height: 28px;
  border: 1px solid #ebdcd5;
  background: white;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-qty-mini:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.mat-qty {
  width: 50px;
  text-align: center;
  padding: 4px 2px;
  font-size: 0.92rem;
  font-weight: 700;
  border: 1px solid #ebdcd5;
  border-radius: var(--radius-sm);
  background: white;
}

.mat-price {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.92rem;
  font-weight: 700;
  border: 1px solid #ebdcd5;
  border-radius: var(--radius-sm);
  background: white;
}

.pricing-mat-subtotal-box {
  text-align: right;
}

.pricing-mat-subtotal-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: block;
}

.pricing-mat-subtotal-val {
  font-size: 1.05rem;
  color: var(--primary);
  font-weight: 800;
}

/* RESUMEN CONSOLIDADO (PASO 5) */
.consolidated-summary-card {
  background: #ffffff;
  border: 2px solid #ebdcd5;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: 0 8px 24px rgba(180, 80, 50, 0.08);
  position: relative;
  overflow: hidden;
}

.consolidated-summary-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent-gold));
}

.consolidated-section-box {
  background: #fbf7f4;
  border: 1.5px solid #ebdcd5;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.consolidated-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-main);
  padding: 3px 0;
}

.consolidated-total-banner {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 2px solid #fed7aa;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.08);
}

.consolidated-big-price {
  font-size: 2.2rem;
  font-weight: 900;
  color: #c2410c;
  line-height: 1.1;
  margin: 6px 0 8px 0;
  letter-spacing: -0.5px;
}

/* SELECTOR MODAL DE STOCK */
.stock-picker-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #ebdcd5;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: all var(--transition-fast);
}

.stock-picker-item:hover {
  border-color: var(--primary);
  background: #fdf8f6;
}

.stock-picker-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stock-picker-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #ebdcd5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .pricing-mat-body {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .pricing-mat-subtotal-box {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed #ebdcd5;
    padding-top: 6px;
    margin-top: 2px;
  }
  .consolidated-big-price {
    font-size: 1.8rem;
  }
  .wizard-footer-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .wizard-footer-actions > div,
  .wizard-footer-actions > button {
    width: 100%;
    justify-content: center;
  }
}

/* Quick loader dropdown grid responsive styling */
.pricing-quick-loader-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.pricing-quick-loader-grid select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.82rem;
  background: white;
  padding: 8px 10px;
}

@media (max-width: 600px) {
  .pricing-quick-loader-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ==========================================================================
   PROJECT & PRICING WIZARD STEPPER & PANELS
   ========================================================================== */

.project-stepper,
.pricing-stepper {
  display: flex;
  gap: 8px;
  background: var(--bg-main, #f8f9fa);
  padding: 8px 14px;
  border-bottom: 1.5px solid var(--border-color, #e5e7eb);
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.project-step-pill,
.pricing-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full, 9999px);
  border: 1.5px solid var(--border-color, #e5e7eb);
  background: white;
  color: var(--text-muted, #4b5563);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast, 0.18s ease);
}

.project-step-pill .step-num,
.pricing-step-pill .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--border-color, #e5e7eb);
  color: var(--text-main, #111827);
  font-size: 0.72rem;
  font-weight: 800;
}

.project-step-pill:hover,
.pricing-step-pill:hover {
  border-color: var(--primary, #d90479);
  color: var(--primary, #d90479);
}

.project-step-pill.active,
.pricing-step-pill.active {
  background: var(--primary, #d90479);
  border-color: var(--primary, #d90479);
  color: white;
  box-shadow: 0 2px 8px rgba(217, 4, 121, 0.25);
}

.project-step-pill.active .step-num,
.pricing-step-pill.active .step-num {
  background: white;
  color: var(--primary, #d90479);
}

.project-step-pill.completed,
.pricing-step-pill.completed {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.project-step-pill.completed .step-num,
.pricing-step-pill.completed .step-num {
  background: #22c55e;
  color: white;
}

/* WIZARD PANELS */
.project-wizard-panel,
.pricing-wizard-panel {
  display: none;
}

.project-wizard-panel.active,
.pricing-wizard-panel.active {
  display: block;
  animation: fadeInPanel 0.22s ease-out;
}

@keyframes fadeInPanel {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* CARDS & ITEMS DENTRO DEL WIZARD DE PROYECTO */
.project-part-item-card {
  background: white;
  border: 1.5px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-md, 14px);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition-fast, 0.18s ease);
}

.project-part-item-card:hover {
  border-color: var(--accent-gold, #f59e0b);
}

.proj-yarn-color-card {
  background: white;
  border: 1.5px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-md, 14px);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition-fast, 0.18s ease);
}

.proj-yarn-color-card:hover {
  border-color: var(--primary, #d90479);
}

.btn-quick-proj-acc {
  background: white;
  border: 1.5px solid var(--border-color, #e5e7eb);
  color: var(--text-main, #111827);
  padding: 4px 10px;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast, 0.18s ease);
}

.btn-quick-proj-acc:hover {
  background: var(--primary-light, #fdf2f8);
  border-color: var(--primary, #d90479);
  color: var(--primary, #d90479);
  transform: translateY(-1px);
}

.consolidated-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
}

/* INTERACTIVE PIECES CHIPS & BUTTONS EN TARJETAS */
.project-card-part-chip {
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.project-card-part-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.08) !important;
  border-color: var(--primary) !important;
}

.project-card-part-chip:active {
  transform: translateY(0);
}

.btn-card-del-part:hover {
  color: #e11d48 !important;
  background: #fee2e2 !important;
  transform: scale(1.15);
}

.btn-del-part-timer:hover {
  color: #e11d48 !important;
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
}

/* ==========================================================================
   LISTA DE COMPRAS & REPOSICIÓN INTELIGENTE (ULTRA-MODERNA & RESPONSIVA)
   ========================================================================== */

.shopping-hero-card {
  background: white;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-lg, 16px);
  padding: 18px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
  width: 100%;
  box-sizing: border-box;
}

.shopping-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  flex-wrap: wrap;
}

.shopping-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shopping-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md, 10px);
  background: linear-gradient(135deg, #fdf2f8, #fce7f3);
  border: 1.5px solid #fbcfe8;
  color: var(--primary, #d90479);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.shopping-main-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main, #111827);
  margin: 0 0 2px 0;
}

.shopping-sub-desc {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  margin: 0;
}

.shopping-metrics-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.shop-metric-pill {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full, 9999px);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.shop-metric-pill.pending {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #ffedd5;
}

.shop-metric-pill.done {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #dcfce7;
}

.shopping-replenish-banner {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1.5px solid #fde68a;
  border-radius: var(--radius-md, 12px);
  padding: 10px 14px;
  margin: 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.shopping-input-wrapper {
  background: #f8fafc;
  border: 1.5px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-md, 12px);
  padding: 12px;
  margin-bottom: 14px;
  width: 100%;
  box-sizing: border-box;
}

.shopping-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.shopping-input-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1.5px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-sm, 8px);
  padding: 0 10px;
  height: 40px;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.shopping-input-field:focus-within {
  border-color: var(--primary, #d90479);
  box-shadow: 0 0 0 3px rgba(217, 4, 121, 0.1);
}

.shopping-input-field i {
  color: #94a3b8;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.shopping-input-field input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-main, #111827);
}

.btn-add-shopping-custom {
  flex-shrink: 0;
  height: 40px;
  padding: 0 14px;
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-sm, 8px);
  white-space: nowrap;
}

.shopping-quick-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 8px;
}

.btn-shop-preset {
  background: white;
  border: 1px solid #e2e8f0;
  color: var(--text-main, #111827);
  padding: 3px 8px;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-shop-preset:hover {
  background: var(--primary-light, #fdf2f8);
  border-color: var(--primary, #d90479);
  color: var(--primary, #d90479);
  transform: translateY(-1px);
}

.shopping-toolbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.shopping-items-list-v2 {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shopping-item-card-v2 {
  transition: all 0.15s ease;
}

.shopping-item-card-v2:hover {
  border-color: #fbcfe8 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.shopping-item-card-v2.done {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  opacity: 0.85;
}

.btn-del-shop-item-v2:hover {
  color: #e11d48 !important;
  background: #fee2e2 !important;
  transform: scale(1.1);
}

/* ==========================================================================
   DESPLAZAMIENTO HORIZONTAL UNIVERSAL (MODO REVISTA / SLIDER TÁCTIL)
   Permite que todos los módulos de inventario, insumos, herramientas,
   marcas, cotizaciones y clientes se desplacen fluidamente hacia los lados.
   ========================================================================== */

.horizontal-scroll-grid,
.yarn-stash-grid,
#suppliesCatalogGrid,
#toolsCatalogGrid,
#brandsCatalogGrid,
#accessoriesCatalogGrid,
.quotes-grid,
#savedQuotesGrid,
.clients-directory-list,
#clientsDirectoryList {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory !important;
  scroll-behavior: smooth !important;
  gap: 16px !important;
  padding: 6px 4px 16px 4px !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin !important;
  scrollbar-color: #cbd5e1 #f1f5f9 !important;
  align-items: stretch !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Scrollbar estilizada y moderna de 6px para todos los contenedores horizontales */
.horizontal-scroll-grid::-webkit-scrollbar,
.yarn-stash-grid::-webkit-scrollbar,
#suppliesCatalogGrid::-webkit-scrollbar,
#toolsCatalogGrid::-webkit-scrollbar,
#brandsCatalogGrid::-webkit-scrollbar,
#accessoriesCatalogGrid::-webkit-scrollbar,
.quotes-grid::-webkit-scrollbar,
#savedQuotesGrid::-webkit-scrollbar,
.clients-directory-list::-webkit-scrollbar,
#clientsDirectoryList::-webkit-scrollbar {
  height: 6px !important;
}

.horizontal-scroll-grid::-webkit-scrollbar-track,
.yarn-stash-grid::-webkit-scrollbar-track,
#suppliesCatalogGrid::-webkit-scrollbar-track,
#toolsCatalogGrid::-webkit-scrollbar-track,
#brandsCatalogGrid::-webkit-scrollbar-track,
#accessoriesCatalogGrid::-webkit-scrollbar-track,
.quotes-grid::-webkit-scrollbar-track,
#savedQuotesGrid::-webkit-scrollbar-track,
.clients-directory-list::-webkit-scrollbar-track,
#clientsDirectoryList::-webkit-scrollbar-track {
  background: #f1f5f9 !important;
  border-radius: 9999px !important;
}

.horizontal-scroll-grid::-webkit-scrollbar-thumb,
.yarn-stash-grid::-webkit-scrollbar-thumb,
#suppliesCatalogGrid::-webkit-scrollbar-thumb,
#toolsCatalogGrid::-webkit-scrollbar-thumb,
#brandsCatalogGrid::-webkit-scrollbar-thumb,
#accessoriesCatalogGrid::-webkit-scrollbar-thumb,
.quotes-grid::-webkit-scrollbar-thumb,
#savedQuotesGrid::-webkit-scrollbar-thumb,
.clients-directory-list::-webkit-scrollbar-thumb,
#clientsDirectoryList::-webkit-scrollbar-thumb {
  background: #cbd5e1 !important;
  border-radius: 9999px !important;
}

.horizontal-scroll-grid::-webkit-scrollbar-thumb:hover,
.yarn-stash-grid::-webkit-scrollbar-thumb:hover,
#suppliesCatalogGrid::-webkit-scrollbar-thumb:hover,
#toolsCatalogGrid::-webkit-scrollbar-thumb:hover,
#brandsCatalogGrid::-webkit-scrollbar-thumb:hover,
#accessoriesCatalogGrid::-webkit-scrollbar-thumb:hover,
.quotes-grid::-webkit-scrollbar-thumb:hover,
#savedQuotesGrid::-webkit-scrollbar-thumb:hover,
.clients-directory-list::-webkit-scrollbar-thumb:hover,
#clientsDirectoryList::-webkit-scrollbar-thumb:hover {
  background: var(--primary) !important;
}

/* Tarjetas individuales dentro de los contenedores horizontales */
.yarn-stash-grid .yarn-card,
#suppliesCatalogGrid > div:not(.empty-state),
#toolsCatalogGrid > div:not(.empty-state),
#brandsCatalogGrid > div:not(.empty-state),
#accessoriesCatalogGrid > div:not(.empty-state),
.quotes-grid .quote-card,
#savedQuotesGrid .quote-card,
.clients-directory-list .client-card,
#clientsDirectoryList .client-card {
  flex: 0 0 310px !important;
  width: 310px !important;
  min-width: 310px !important;
  max-width: 310px !important;
  scroll-snap-align: start !important;
  scroll-snap-stop: normal !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

/* En pantallas móviles, cada tarjeta ocupa el 86vw para ver un peek sutil de la siguiente */
@media (max-width: 600px) {
  .yarn-stash-grid .yarn-card,
  #suppliesCatalogGrid > div:not(.empty-state),
  #toolsCatalogGrid > div:not(.empty-state),
  #brandsCatalogGrid > div:not(.empty-state),
  #accessoriesCatalogGrid > div:not(.empty-state),
  .quotes-grid .quote-card,
  #savedQuotesGrid .quote-card,
  .clients-directory-list .client-card,
  #clientsDirectoryList .client-card {
    flex: 0 0 86vw !important;
    width: 86vw !important;
    min-width: 86vw !important;
    max-width: 86vw !important;
  }
}

/* Estados vacíos (placeholder) ocupan el ancho completo */
.yarn-stash-grid > div[style*="grid-column"],
#suppliesCatalogGrid > div[style*="grid-column"],
#toolsCatalogGrid > div[style*="grid-column"],
#brandsCatalogGrid > div[style*="grid-column"],
#accessoriesCatalogGrid > div[style*="grid-column"],
.quotes-grid > div[style*="grid-column"],
#savedQuotesGrid > div[style*="grid-column"],
.empty-state {
  flex: 0 0 100% !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
}

/* Barra de ayuda y controles de navegación horizontal */
.module-horizontal-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  gap: 8px;
}

.module-horizontal-nav-bar .nav-label {
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.module-horizontal-nav-bar .nav-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.module-horizontal-nav-bar .btn-nav-arrow {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.15s ease;
}

.module-horizontal-nav-bar .btn-nav-arrow:hover {
  background: var(--bg-main);
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.05);
}

/* ============================================================
   ESTILOS PREMIUM: MODAL COMPARTIR AVANCE CON CLIENTE (WHATSAPP)
   ============================================================ */
.wa-progress-modal-card {
  border-radius: 20px !important;
  background: #ffffff !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25) !important;
}

.wa-milestone-btn {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  color: #334155 !important;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03) !important;
  text-align: left !important;
}

.wa-milestone-btn:hover {
  background: #f0fdf4 !important;
  border-color: #86efac !important;
  color: #166534 !important;
  transform: translateY(-1px) !important;
}

.wa-milestone-btn.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border-color: #059669 !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35) !important;
  font-weight: 800 !important;
}

.wa-milestone-btn.wa-certificate-btn {
  background: #fdf2f8 !important;
  border-color: #fbcfe8 !important;
  color: #be185d !important;
}

.wa-milestone-btn.wa-certificate-btn:hover {
  background: #fce7f3 !important;
  border-color: #f472b6 !important;
  color: #9d174d !important;
}

.wa-milestone-btn.wa-certificate-btn.active {
  background: linear-gradient(135deg, #ec4899 0%, #be185d 100%) !important;
  border-color: #be185d !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(190, 24, 93, 0.35) !important;
}

/* Burbuja de Chat tipo WhatsApp con fondo característico */
.wa-chat-bubble-container {
  background-color: #e5ddd5 !important;
  background-image: radial-gradient(#d1c7bc 1px, transparent 1px) !important;
  background-size: 14px 14px !important;
}

.wa-chat-bubble {
  border-left: 4px solid #25d366 !important;
  font-size: 0.86rem !important;
  line-height: 1.5 !important;
}

/* ==========================================================================
   VISTA EN TABLA DE INVENTARIO DE LANAS & SELECTOR DE MODO
   ========================================================================== */
.yarn-view-mode-selector {
  display: inline-flex;
  background: #f1f5f9;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.btn-yarn-view-mode {
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 750;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #64748b;
  transition: all var(--transition-fast);
}

.btn-yarn-view-mode:hover {
  color: var(--text-main);
}

.btn-yarn-view-mode.active {
  background: white !important;
  color: var(--primary) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.yarn-table-wrapper {
  background: white;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.yarn-inventory-table,
.supplies-inventory-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
  min-width: 100%;
}

@media (min-width: 641px) {
  .yarn-inventory-table,
.supplies-inventory-table {
    min-width: 680px;
  }
  .mobile-meta-line,
  .mobile-stock-line {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .yarn-table-wrapper {
    overflow-x: hidden !important;
    border-radius: 10px;
  }
  .yarn-inventory-table,
.supplies-inventory-table {
    min-width: 100% !important;
    width: 100% !important;
    table-layout: fixed;
  }
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: inline-block !important;
  }
  .yarn-inventory-table th.col-swatch,
  .supplies-inventory-table th.col-swatch {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    padding: 8px 2px !important;
    text-align: center !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
  .yarn-inventory-table th.col-main,
  .supplies-inventory-table th.col-main {
    width: auto !important;
    padding: 8px 4px 8px 8px !important;
    text-align: left !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
  .yarn-inventory-table th.col-actions,
  .supplies-inventory-table th.col-actions {
    width: 118px !important;
    min-width: 118px !important;
    max-width: 118px !important;
    padding: 8px 4px !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }
  .yarn-inventory-table td.col-swatch,
  .supplies-inventory-table td.col-swatch {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    padding: 8px 2px !important;
    text-align: center !important;
    vertical-align: middle;
    box-sizing: border-box !important;
  }
  .yarn-inventory-table td.col-main,
  .supplies-inventory-table td.col-main {
    padding: 8px 4px 8px 8px !important;
    vertical-align: middle;
    word-break: break-word;
    box-sizing: border-box !important;
  }
  .yarn-inventory-table td.col-actions,
  .supplies-inventory-table td.col-actions {
    width: 118px !important;
    min-width: 118px !important;
    max-width: 118px !important;
    padding: 8px 4px !important;
    text-align: center !important;
    vertical-align: middle;
    box-sizing: border-box !important;
  }
  .yarn-table-action-btns {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 3px !important;
    justify-content: center !important;
  }
}

.yarn-inventory-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 750;
  padding: 10px 12px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.yarn-inventory-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.yarn-inventory-table tbody tr:hover td {
  background: #fdf2f840;
}

.yarn-inventory-table tbody tr:last-child td {
  border-bottom: none;
}

@media (max-width: 600px) {
  .module-horizontal-nav-bar {
    flex-wrap: wrap !important;
  }
  .yarn-view-mode-selector {
    width: 100%;
    margin-top: 6px;
    display: flex;
  }
  .yarn-view-mode-selector .btn-yarn-view-mode {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.82rem;
  }
}








/* Control definitivo de visibilidad entre Tarjetas y Tabla */
.yarn-stash-grid.hidden-by-view-mode,
#yarnGrid.hidden-by-view-mode {
  display: none !important;
}

.yarn-table-wrapper.hidden-by-view-mode,
#yarnTableWrapper.hidden-by-view-mode {
  display: none !important;
}

#modalAddYarnToShoppingStepper.active {
  display: flex !important;
}


/* Control definitivo y absoluto de visibilidad entre Tarjetas y Tabla (Prioridad Maxima) */
body.yarn-view-table #yarnGrid,
body.yarn-view-table .yarn-stash-grid,
.yarn-view-table #yarnGrid,
.yarn-view-table .yarn-stash-grid,
#yarnGrid.hidden-by-view-mode,
.yarn-stash-grid.hidden-by-view-mode {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

body.yarn-view-cards #yarnTableWrapper,
body.yarn-view-cards .yarn-table-wrapper,
.yarn-view-cards #yarnTableWrapper,
.yarn-view-cards .yarn-table-wrapper,
#yarnTableWrapper.hidden-by-view-mode,
.yarn-table-wrapper.hidden-by-view-mode {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

#modalAddYarnToShoppingStepper.active {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 10000050 !important;
}


/* ==========================================================================
   TABLA RESPONSIVA DE INSUMOS & SELECTOR DE VISTA (TABLA / TARJETAS)
   ========================================================================== */

.supplies-view-mode-selector {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-sm);
  gap: 2px;
}

.btn-supplies-view-mode {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-supplies-view-mode.active {
  background: white;
  color: #c026d3;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Control definitivo de visibilidad entre Tarjetas y Tabla para Insumos */
body.supplies-view-table #suppliesCatalogGrid,
body.supplies-view-table .supplies-catalog-grid,
.supplies-view-table #suppliesCatalogGrid,
#suppliesCatalogGrid.hidden-by-view-mode {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

body.supplies-view-cards #suppliesTableWrapper,
body.supplies-view-cards .supplies-table-wrapper,
.supplies-view-cards #suppliesTableWrapper,
#suppliesTableWrapper.hidden-by-view-mode {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

#modalAddSupplyToShoppingStepper.active {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 10000050 !important;
}
