/* ==========================================================================
   INVENTARIO PARA EL HOGAR - MODERN MOBILE-FIRST STYLES CON FOTOS Y SECCIONES
   ========================================================================== */

:root {
  /* Color Palette */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  /* Status & Destination Colors */
  --color-guardar: #2563eb;
  --color-guardar-bg: #eff6ff;
  --color-guardar-border: #93c5fd;

  --color-llevar: #7c3aed;
  --color-llevar-bg: #f5f3ff;
  --color-llevar-border: #c4b5fd;
  
  --color-donar: #d97706;
  --color-donar-bg: #fffbeb;
  --color-donar-border: #fcd34d;
  
  --color-vender: #16a34a;
  --color-vender-bg: #f0fdf4;
  --color-vender-border: #86efac;

  /* State colors */
  --state-excelente: #15803d;
  --state-excelente-bg: #f0fdf4;
  --state-buen-estado: #0284c7;
  --state-buen-estado-bg: #f0f9ff;
  --state-regular: #b45309;
  --state-regular-bg: #fefce8;
  --state-reparar: #dc2626;
  --state-reparar-bg: #fef2f2;
  
  /* Neutral Palette */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-muted: #94a3b8;

  /* Elevation Shadows */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.04);

  /* Radius & Transitions */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 80px; /* Room for FAB and safe mobile scrolling */
}

/* Offline Indicator */
.offline-indicator {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #f59e0b;
  color: #78350f;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  box-shadow: var(--shadow-sm);
}

/* Layout container */
.app-layout {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0;
}

/* Header & Navigation */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-xs);
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 12px;
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.brand-icon svg {
  width: 22px;
  height: 22px;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Barra de Navegación Principal de Vistas */
.main-view-nav {
  display: flex;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  padding: 4px 16px;
  gap: 8px;
}

.view-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.view-nav-tab:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.view-nav-tab.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
  font-weight: 700;
}

.tab-pill-badge {
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-tertiary);
}

.view-nav-tab.active .tab-pill-badge {
  background: var(--primary-light);
  color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary-border);
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-danger {
  background: #ef4444;
  color: white;
}

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

.btn-icon {
  padding: 9px;
}

.btn-icon-subtle {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-subtle:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn-text-desktop {
  display: none;
}

@media (min-width: 640px) {
  .btn-text-desktop {
    display: inline;
  }
}

/* Metrics Dashboard Cards */
.metrics-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px 16px 14px;
  background: #fafafa;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 640px) {
  .metrics-container {
    grid-template-columns: repeat(3, 1fr);
    padding: 14px 20px;
    gap: 12px;
  }
}

@media (min-width: 900px) {
  .metrics-container {
    grid-template-columns: repeat(5, 1fr);
  }
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition);
}

.metric-card:hover {
  transform: translateY(-1px);
}

.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon svg {
  width: 18px;
  height: 18px;
}

.total-icon {
  background: #f1f5f9;
  color: #334155;
}

.guardar-icon {
  background: var(--color-guardar-bg);
  color: var(--color-guardar);
}

.llevar-icon {
  background: var(--color-llevar-bg);
  color: var(--color-llevar);
}

.donar-icon {
  background: var(--color-donar-bg);
  color: var(--color-donar);
}

.vender-icon {
  background: var(--color-vender-bg);
  color: var(--color-vender);
}

.metric-data {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.metric-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.metric-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.vender-values {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}

.vender-divider {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.metric-value-cash {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--color-vender);
}

/* Filters & Search Panel */
.filters-panel {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  pointer-events: none;
}

#search-input {
  width: 100%;
  padding: 10px 38px 10px 38px;
  font-family: inherit;
  font-size: 0.88rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--transition);
  outline: none;
}

#search-input:focus {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
}

.tag-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.tag-filter-group::-webkit-scrollbar {
  display: none;
}

.tag-pill {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}

.tag-pill:hover {
  background: var(--bg-subtle);
}

.tag-pill.active {
  background: var(--text-primary);
  color: white;
  border-color: var(--text-primary);
}

.tag-guardar-pill.active {
  background: var(--color-guardar);
  border-color: var(--color-guardar);
}

.tag-llevar-pill.active {
  background: var(--color-llevar);
  border-color: var(--color-llevar);
}

.tag-donar-pill.active {
  background: var(--color-donar);
  border-color: var(--color-donar);
}

.tag-vender-pill.active {
  background: var(--color-vender);
  border-color: var(--color-vender);
}

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

.dot-guardar { background: var(--color-guardar); }
.dot-llevar { background: var(--color-llevar); }
.dot-donar { background: var(--color-donar); }
.dot-vender { background: var(--color-vender); }

.pill-count {
  font-size: 0.72rem;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.08);
  padding: 1px 6px;
  border-radius: 10px;
}

.tag-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.25);
}

/* Sections Nav Scroller (Pestañas por Sección en el Inventario) */
.sections-nav {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
}

.sections-scroller {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 6px 12px;
  gap: 6px;
}

.sections-scroller::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.tab-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
  font-weight: 700;
}

.tab-badge {
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.tab-btn.active .tab-badge {
  background: var(--primary);
  color: white;
}

/* Main Content & Section Headline */
.main-content {
  padding: 16px;
  flex: 1;
}

@media (min-width: 640px) {
  .main-content {
    padding: 24px;
  }
}

.section-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.headline-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.section-badge-counter {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.headline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-dropdown {
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
}

.btn-mini-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.btn-mini-toggle:hover {
  background: var(--bg-subtle);
}

.btn-mini-toggle.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

/* Room Breakdown / Filtros Drawer Card */
.room-breakdown-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  animation: slideDownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filters-expanded-card .breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.filters-card-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.filters-card-header-title h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.filters-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-text-subtle {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.btn-text-subtle:hover {
  text-decoration: underline;
  background: var(--primary-light);
}

.filters-expanded-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Distribución en 2 columnas: Columna 1 (Categoría + Tipo) y Columna 2 (Habitaciones) */
.filters-two-columns-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .filters-two-columns-layout {
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
  }
}

.filters-col-attributes {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 768px) {
  .filters-col-attributes {
    border-right: 1px solid var(--border);
    padding-right: 24px;
  }
}

.filters-col-rooms {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.filters-col-attributes .category-filter-wrapper {
  width: 100%;
}

.filters-col-attributes .category-select-box {
  width: 100%;
}

.tag-filter-group-vertical {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (min-width: 768px) {
  .tag-filter-group-vertical {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .tag-filter-group-vertical .tag-pill {
    width: 100%;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 7px 12px;
  }
}

.filter-group-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-rooms-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-group-hint {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.breakdown-item {
  padding: 9px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.breakdown-item:hover {
  background: white;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.breakdown-item.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.breakdown-item.active .breakdown-name {
  color: var(--primary);
  font-weight: 800;
}

.breakdown-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.breakdown-counts {
  display: flex;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 3px;
}

.breakdown-item.active .breakdown-counts {
  color: var(--primary);
  opacity: 0.85;
}

/* Items Grid & Cards (Scannable Cards con soporte para fotos) */
.items-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .items-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .items-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.item-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Foto de Portada en Tarjeta */
.card-photo-wrapper {
  position: relative;
  width: 100%;
  height: 180px;
  background: #f1f5f9;
  cursor: pointer;
  overflow: hidden;
}

.card-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card-photo-wrapper:hover .card-photo-img {
  transform: scale(1.04);
}

.photo-badge-card {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.item-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  word-break: break-word;
}

.item-section-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.item-badge-destination {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-guardar {
  background: var(--color-guardar-bg);
  color: var(--color-guardar);
  border: 1px solid var(--color-guardar-border);
}

.badge-llevar {
  background: var(--color-llevar-bg);
  color: var(--color-llevar);
  border: 1px solid var(--color-llevar-border);
}

.badge-donar {
  background: var(--color-donar-bg);
  color: var(--color-donar);
  border: 1px solid var(--color-donar-border);
}

.badge-vender {
  background: var(--color-vender-bg);
  color: var(--color-vender);
  border: 1px solid var(--color-vender-border);
}

.badge-price {
  font-weight: 800;
  margin-left: 2px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.status-excelente {
  background: var(--state-excelente-bg);
  color: var(--state-excelente);
  border: 1px solid rgba(21, 128, 61, 0.2);
}

.status-buen-estado {
  background: var(--state-buen-estado-bg);
  color: var(--state-buen-estado);
  border: 1px solid rgba(2, 132, 199, 0.2);
}

.status-regular {
  background: var(--state-regular-bg);
  color: var(--state-regular);
  border: 1px solid rgba(180, 83, 9, 0.2);
}

.status-para-reparar {
  background: var(--state-reparar-bg);
  color: var(--state-reparar);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.card-notes {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border-left: 3px solid var(--border-strong);
  padding: 8px 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.4;
  word-break: break-word;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  gap: 8px;
  background: #fcfcfc;
}

.card-date {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-card-action {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition);
}

.btn-card-action:hover {
  background: white;
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.btn-card-delete:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* ==========================================================================
   VISTA 2: GESTIÓN DE SECCIONES DEL HOGAR
   ========================================================================== */
.sections-mgmt-header {
  margin-bottom: 20px;
}

.view-heading {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.view-subheading {
  font-size: 0.86rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.section-form-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.section-form-card-header {
  margin-bottom: 14px;
}

.section-form-card-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.card-hint {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.section-form-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.text-emoji {
  font-size: 1.4rem;
  height: 48px;
}

.emoji-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
  padding: 4px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.btn-emoji {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition);
}

.btn-emoji:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  transform: scale(1.05);
}

.section-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

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

.subtitle-bold {
  font-size: 1.1rem;
  font-weight: 800;
}

.sections-counter-pill {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-tertiary);
}

.sections-manage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .sections-manage-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .sections-manage-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.section-mgmt-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition);
}

.section-mgmt-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.section-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.section-icon-large {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-card-info {
  flex: 1;
}

.section-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.section-card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.3;
}

.section-card-count {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.section-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

/* ==========================================================================
   PHOTO UPLOADER & LIGHTBOX COMPONENT
   ========================================================================== */
.photo-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.photo-counter-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
}

.photo-uploader-box {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.photo-uploader-box:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.hidden-file-input {
  display: none;
}

.photo-uploader-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  margin-bottom: 8px;
}

.btn-photo-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid transparent;
}

.btn-photo-camera {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

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

.btn-photo-gallery {
  background: white;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-photo-gallery:hover {
  background: var(--bg-subtle);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.uploader-subtitle {
  font-size: 0.74rem;
  color: var(--text-tertiary);
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.photo-preview-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.photo-preview-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-photo {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.9);
  color: white;
  border: none;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

/* Lightbox Modal */
.lightbox-container {
  position: relative;
  width: 92%;
  max-width: 720px;
  max-height: 90vh;
  background: rgba(15, 23, 42, 0.95);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-xl);
}

.lightbox-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.lightbox-media-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  max-height: 65vh;
}

.lightbox-img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  padding: 4px 8px;
}

.lightbox-caption {
  font-size: 0.84rem;
  font-weight: 600;
}

.lightbox-nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-lightbox {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-lightbox:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Modals & Drawer (Bottom Sheet on Mobile, Centered on Desktop) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 100;
  display: flex;
  align-items: flex-end; /* Mobile Bottom Sheet */
  justify-content: center;
  padding: 0;
  transition: opacity var(--transition);
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 24px;
  }
}

.modal-drawer {
  background: var(--bg-card);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  max-height: 90dvh;
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .modal-drawer {
    border-radius: 20px;
    animation: zoomIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

.drawer-handle {
  width: 36px;
  height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  margin: 10px auto 2px;
}

@media (min-width: 640px) {
  .drawer-handle {
    display: none;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.modal-subtitle {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.modal-form {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-row {
  display: flex;
  gap: 12px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.form-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.required-indicator {
  color: #ef4444;
}

.optional-badge {
  font-weight: 500;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--transition);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.text-center { text-align: center; }

.form-textarea {
  resize: vertical;
}

.form-error {
  font-size: 0.74rem;
  color: #ef4444;
  font-weight: 600;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

/* Destination Radio Cards (Todos del mismo tamaño) */
.destination-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 520px) {
  .destination-selector {
    grid-template-columns: repeat(4, 1fr);
  }
}

.dest-option {
  position: relative;
  cursor: pointer;
  display: flex;
  flex: 1;
}

.dest-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dest-content {
  width: 100%;
  height: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  background: var(--bg-card);
  transition: all var(--transition);
  box-sizing: border-box;
  min-height: 94px;
}

.dest-indicator {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.dest-texts {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dest-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dest-desc {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  line-height: 1.15;
  margin-top: 2px;
}

.dest-guardar input:checked ~ .dest-content {
  border-color: var(--color-guardar);
  background: var(--color-guardar-bg);
}
.dest-guardar input:checked ~ .dest-content .dest-indicator {
  background: var(--color-guardar);
  color: white;
}
.dest-guardar input:checked ~ .dest-content .dest-title {
  color: var(--color-guardar);
}

.dest-llevar input:checked ~ .dest-content {
  border-color: var(--color-llevar);
  background: var(--color-llevar-bg);
}
.dest-llevar input:checked ~ .dest-content .dest-indicator {
  background: var(--color-llevar);
  color: white;
}
.dest-llevar input:checked ~ .dest-content .dest-title {
  color: var(--color-llevar);
}

.dest-donar input:checked ~ .dest-content {
  border-color: var(--color-donar);
  background: var(--color-donar-bg);
}
.dest-donar input:checked ~ .dest-content .dest-indicator {
  background: var(--color-donar);
  color: white;
}
.dest-donar input:checked ~ .dest-content .dest-title {
  color: var(--color-donar);
}

.dest-vender input:checked ~ .dest-content {
  border-color: var(--color-vender);
  background: var(--color-vender-bg);
}
.dest-vender input:checked ~ .dest-content .dest-indicator {
  background: var(--color-vender);
  color: white;
}
.dest-vender input:checked ~ .dest-content .dest-title {
  color: var(--color-vender);
}

/* Dynamic Field: Price */
.dynamic-field {
  transition: all 0.22s ease-out;
}

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

.currency-symbol {
  position: absolute;
  left: 14px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-vender);
  pointer-events: none;
}

.form-input-money {
  padding-left: 32px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-vender);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.btn-save {
  flex: 2;
}

/* Confirmation Dialog */
.confirm-dialog {
  background: white;
  width: 90%;
  max-width: 400px;
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-xl);
  animation: zoomIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.delete-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fef2f2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.confirm-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.confirm-actions {
  display: flex;
  width: 100%;
  gap: 10px;
  margin-top: 8px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
  width: 90%;
  max-width: 420px;
}

.toast {
  background: #0f172a;
  color: white;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-success { border-left: 4px solid #10b981; }
.toast-info { border-left: 4px solid #3b82f6; }
.toast-error { border-left: 4px solid #ef4444; }

/* Utilities */
.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Floating Action Button (Mobile FAB) */
.fab-button {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: white;
  border: none;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  transition: all var(--transition);
}

.fab-button:active {
  transform: scale(0.92);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: white;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.empty-illustration {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-illustration svg {
  width: 32px;
  height: 32px;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 340px;
  margin-bottom: 8px;
}

/* Keyframes */
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   ESTILOS DE COPIA DE SEGURIDAD Y RESTAURACIÓN (ZIP)
   ========================================================================== */
.backup-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.backup-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition);
}

.backup-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.backup-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.export-icon {
  background: var(--primary-light);
  color: var(--primary);
}

.restore-icon {
  background: #fffbeb;
  color: #d97706;
}

.backup-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.backup-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.backup-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.btn-backup-action {
  align-self: flex-start;
  margin-top: 6px;
  font-size: 0.84rem;
}

.backup-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 6px;
  text-align: center;
  background: var(--bg-subtle);
  cursor: pointer;
  transition: all var(--transition);
}

.backup-dropzone:hover {
  border-color: #d97706;
  background: #fffdf5;
}

.backup-dropzone-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
}

/* ==========================================================================
   ESTILOS DE CATEGORÍAS Y CANTIDAD DE PRODUCTOS
   ========================================================================== */
.filters-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.filters-controls-row .tag-filter-group {
  flex: 1 1 auto;
  min-width: 0;
}

.category-filter-wrapper {
  flex: 0 0 auto;
  margin-top: 0;
  min-width: 200px;
}

.category-select-box {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  gap: 8px;
  box-shadow: var(--shadow-xs);
  height: 36px;
  box-sizing: border-box;
}

.category-select-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.category-filter-select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  width: 100%;
  outline: none;
  cursor: pointer;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
}

.btn-text-action:hover {
  text-decoration: underline;
  background: var(--primary-light);
}

/* Stepper de Cantidad */
.qty-stepper-box {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  overflow: hidden;
}

.btn-qty-step {
  background: white;
  border: none;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 700;
  width: 38px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.btn-qty-step:hover {
  background: var(--bg-subtle);
  color: var(--primary);
}

.form-input-qty {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 8px !important;
  font-weight: 700 !important;
  height: 40px;
  -moz-appearance: textfield;
}

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

/* Badges de Categoría y Cantidad en las Tarjetas */
.item-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.item-quantity-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 800;
  color: #1e40af;
  background: #dbeafe;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Imagen / Placeholder por defecto según la Categoría */
.card-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  user-select: none;
  cursor: pointer;
}

.placeholder-cat-icon {
  font-size: 2.8rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
  transition: transform 0.2s ease;
}

.card-photo-placeholder:hover .placeholder-cat-icon {
  transform: scale(1.1);
}

.placeholder-cat-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Selector de Modo de Vista (Tarjetas / Lista) */
.view-mode-toggle {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.btn-view-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-view-mode:hover {
  color: var(--text-primary);
}

.btn-view-mode.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
  font-weight: 700;
}

@media (max-width: 480px) {
  .view-mode-text {
    display: none;
  }
}

/* Estilo para Botón de Visualización de Ítem */
.btn-card-view {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition);
}

.btn-card-view:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Modo de Visualización en Lista Compacta */
.items-container-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.items-container-list .item-card {
  flex-direction: row !important;
  align-items: center !important;
  padding: 10px 14px !important;
  gap: 12px !important;
  min-height: 72px;
}

.items-container-list .card-photo-wrapper {
  width: 58px !important;
  height: 58px !important;
  min-width: 58px !important;
  border-radius: var(--radius-sm) !important;
  flex-shrink: 0 !important;
}

.items-container-list .photo-badge-card {
  display: none !important;
}

.items-container-list .placeholder-cat-icon {
  font-size: 1.4rem !important;
}

.items-container-list .placeholder-cat-label {
  display: none !important;
}

.items-container-list .card-body {
  padding: 0 !important;
  gap: 4px !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.items-container-list .card-top {
  align-items: center !important;
  gap: 8px !important;
}

.items-container-list .item-name {
  font-size: 0.92rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.items-container-list .card-meta {
  display: none !important;
}

.items-container-list .card-notes {
  display: none !important;
}

.items-container-list .card-footer {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  flex-shrink: 0 !important;
}

.items-container-list .card-date {
  display: none !important;
}

@media (max-width: 640px) {
  .items-container-list .item-badge-destination {
    padding: 2px 6px !important;
    font-size: 0.7rem !important;
  }
  .items-container-list .btn-card-edit,
  .items-container-list .btn-card-delete {
    display: none;
  }
}

/* ==========================================================================
   MODAL DE VISUALIZACIÓN COMPLETA (POPUP DETALLE)
   ========================================================================== */
.view-item-modal-dialog {
  background: white;
  border-radius: var(--radius-lg);
  width: 94%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: modalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.view-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}

.view-modal-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.view-modal-body {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.view-modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.view-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: var(--bg-subtle);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.view-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.view-info-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.view-info-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.view-notes-box {
  background: #fdfefe;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.view-notes-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Carrusel de Fotos en Detalle del Ítem */
.view-carousel-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.view-carousel-container {
  position: relative;
  width: 100%;
  height: 280px;
  background: #0f172a;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 640px) {
  .view-carousel-container {
    height: 340px;
  }
}

.view-carousel-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.view-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 5;
  transition: all var(--transition);
}

.view-carousel-btn:hover {
  background: rgba(15, 23, 42, 0.9);
  transform: translateY(-50%) scale(1.08);
}

.view-carousel-prev {
  left: 10px;
}

.view-carousel-next {
  right: 10px;
}

.view-carousel-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  z-index: 5;
}

.view-carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 0;
}

.view-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  padding: 0;
}

.view-carousel-dot.active {
  background: var(--primary);
  width: 20px;
  border-radius: 10px;
}

.view-carousel-thumbs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: thin;
}

.view-carousel-thumb {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #f1f5f9;
  opacity: 0.65;
  transition: all 0.2s ease;
}

.view-carousel-thumb.active {
  border-color: var(--primary);
  opacity: 1;
  transform: scale(1.04);
}

.view-carousel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.view-modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

/* ==========================================================================
   MULTI-PROPERTY (CASA) SELECTOR & SWITCHER
   ========================================================================== */
.property-switcher-box {
  position: relative;
  display: inline-block;
}

.btn-property-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.btn-property-switch:hover {
  background: var(--bg-hover);
  border-color: var(--border-focus);
}

.property-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.property-name {
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.property-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 230px;
  max-width: 300px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 1000;
  animation: fadeInDown 0.18s ease-out;
}

.dropdown-header {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 6px 10px 4px;
}

.property-list-items {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.property-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-main);
  transition: background 0.15s ease;
}

.property-menu-item:hover {
  background: var(--bg-hover);
}

.property-menu-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.property-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.property-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.property-badge-count {
  font-size: 0.72rem;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 999px;
  color: var(--text-muted);
}

.property-menu-item.active .property-badge-count {
  background: rgba(37, 99, 235, 0.15);
  color: var(--primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.dropdown-item-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
  color: var(--text-main);
  transition: background 0.15s ease;
}

.dropdown-item-btn:hover {
  background: var(--bg-hover);
}

.dropdown-item-btn.item-btn-accent {
  color: var(--primary);
}

.dropdown-item-btn.item-btn-accent:hover {
  background: var(--primary-light);
}

.dropdown-item-btn.text-danger {
  color: #dc2626;
}

.dropdown-item-btn.text-danger:hover {
  background: #fef2f2;
}

/* ==========================================================================
   USER PROFILE & LOGOUT MENU
   ========================================================================== */
.user-menu-box {
  position: relative;
  display: inline-block;
}

.btn-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-user-avatar:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 1000;
  animation: fadeInDown 0.18s ease-out;
}

.user-dropdown-header {
  padding: 8px 10px;
}

.user-info-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
}

.user-info-user {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   AUTH GATE SCREEN / OVERLAY (LOGIN / REGISTER)
   ========================================================================== */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top right, #e0e7ff 0%, #f8fafc 60%, #e2e8f0 100%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 32px 28px;
  animation: fadeInUp 0.25s ease-out;
}

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

.auth-logo-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--primary), #1e40af);
  color: #ffffff;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px -4px rgba(37, 99, 235, 0.35);
}

.auth-logo-badge svg {
  width: 32px;
  height: 32px;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 0;
}

.auth-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.auth-tab-btn {
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

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

.auth-btn-submit {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  margin-top: 6px;
}

.auth-error-alert {
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
}

.auth-demo-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
  background: #f8fafc;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.auth-demo-hint code {
  background: #e2e8f0;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 600;
  color: var(--text-main);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   PANEL DE ADMINISTRACIÓN DE CASAS / PROPIEDADES
   ========================================================================== */
.sections-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.casas-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 24px;
}

.casas-info-banner .info-banner-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.casas-info-banner .info-banner-content {
  font-size: 0.88rem;
  color: #166534;
  line-height: 1.45;
}

.casas-manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 12px;
}

.casa-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.casa-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.casa-card.active-casa-card {
  border-color: var(--primary);
  background: linear-gradient(to bottom, #f8faff, #ffffff);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-md);
}

.casa-card-badge-active {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.casa-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.casa-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.casa-card-info {
  flex: 1;
  min-width: 0;
}

.casa-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 60px;
}

.casa-card-address {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}

.casa-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.casa-card-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 10px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  margin: 14px 0 18px;
  border: 1px solid var(--border);
}

.casa-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.casa-stat-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.casa-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

.casa-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.btn-select-casa {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-select-casa.is-active {
  background: #f1f5f9;
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: default;
}

/* ==========================================================================
   OPTIMIZACIONES Y RESPONSIVIDAD MÓVIL INTEGRAL (< 640px)
   ========================================================================== */
@media (max-width: 640px) {
  /* 1. Header más compacto y limpio */
  .header-main {
    padding: 10px 12px;
    gap: 8px;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
  }

  .brand-icon svg {
    width: 18px;
    height: 18px;
  }

  .brand-title {
    font-size: 1rem;
    line-height: 1.1;
  }

  /* Ocultar subtítulo largo en móviles para ganar espacio */
  .brand-subtitle {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  /* Selector de Casa más compacto */
  .btn-property-switch {
    padding: 6px 9px;
    font-size: 0.8rem;
    gap: 5px;
  }

  .property-icon {
    font-size: 1rem;
  }

  .property-name {
    max-width: 85px;
  }

  /* Botón 'Nuevo Ítem' en el header para móviles: solo ícono '+' */
  .btn-add-header {
    padding: 7px 10px;
    font-size: 0.82rem;
  }

  .btn-add-header span {
    display: none;
  }

  .btn-user-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }

  /* 2. Barra de Navegación de Vistas Principal */
  .main-view-nav {
    padding: 2px 8px;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .main-view-nav::-webkit-scrollbar {
    display: none;
  }

  .view-nav-tab {
    padding: 7px 10px;
    font-size: 0.8rem;
    gap: 6px;
    flex-shrink: 0;
  }

  .view-nav-tab svg {
    width: 16px;
    height: 16px;
  }

  /* 3. Cuadrícula de Métricas en Móvil */
  .metrics-container {
    padding: 10px 12px;
    gap: 8px;
    grid-template-columns: repeat(2, 1fr);
  }

  /* La 5ta tarjeta (Venta Estimada) ocupa las 2 columnas completas */
  .metric-vender {
    grid-column: span 2;
  }

  .metric-card {
    padding: 8px 10px;
    gap: 8px;
  }

  .metric-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .metric-icon svg {
    width: 16px;
    height: 16px;
  }

  .metric-value {
    font-size: 1rem;
  }

  .metric-label {
    font-size: 0.65rem;
  }

  .metric-value-cash {
    font-size: 0.88rem;
  }

  /* 4. Barra de Búsqueda y Filtros */
  .filters-panel {
    padding: 10px 12px 6px;
  }

  #search-input {
    padding: 8px 34px 8px 34px;
    font-size: 0.84rem;
  }

  .main-content {
    padding: 12px;
  }

  /* 5. Cabecera de Sección y Controles (Detalle/Lista, Orden, Filtros) */
  .section-headline {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }

  .headline-left {
    justify-content: space-between;
    width: 100%;
  }

  .section-title {
    font-size: 1.1rem;
  }

  .headline-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    flex-wrap: nowrap;
  }

  .view-mode-toggle {
    flex-shrink: 0;
  }

  .btn-view-mode {
    padding: 5px 8px;
    font-size: 0.74rem;
  }

  .sort-dropdown {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 150px;
    padding: 6px 8px;
    font-size: 0.74rem;
  }

  .btn-mini-toggle {
    padding: 6px 9px;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  /* 6. Panel de Filtros Desplegable en Móvil */
  .room-breakdown-card {
    padding: 14px;
    margin-bottom: 16px;
  }

  .filters-two-columns-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .filters-col-attributes {
    border-right: none;
    padding-right: 0;
    gap: 12px;
  }

  .breakdown-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .breakdown-item {
    padding: 8px 10px;
  }

  .breakdown-name {
    font-size: 0.78rem;
  }

  /* 7. Cuadrícula de Tarjetas de Ítems */
  .items-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .item-card {
    border-radius: var(--radius-md);
  }

  /* 8. Formularios en Móvil (Evitar overflow en filas) */
  .form-row {
    flex-direction: column;
    gap: 12px;
  }

  .form-input, .form-select, .form-textarea {
    font-size: 16px; /* Evita que Safari/Chrome en iOS haga zoom automático molesto */
  }

  /* 9. Casas Gestión Grid en Móvil */
  .casas-manage-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .casa-card {
    padding: 16px;
  }

  .casa-card-avatar {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }

  .casa-card-metrics-grid {
    padding: 8px;
    margin: 10px 0 14px;
  }

  .casa-stat-value {
    font-size: 0.92rem;
  }
}
