/* ============================================
   BELLAZENCARE — Admin & CRM Design System
   ============================================ */

:root {
  /* Colors */
  --color-primary: #1a5c3a;
  --color-primary-light: #2d8f5e;
  --color-primary-dark: #0e3a24;
  --color-accent-gold: #c9a96e;
  --color-accent-gold-light: #e8d5a8;
  --color-accent-gold-dark: #a67c3d;
  
  --color-bg-main: #f8f6f0;
  --color-bg-surface: #ffffff;
  --color-bg-sidebar: #0f161e;
  --color-bg-sidebar-active: #172330;
  
  --color-text: #1d2129;
  --color-text-secondary: #5e6676;
  --color-text-muted: #8c95a6;
  --color-text-light: #fdfbf7;
  
  --color-border: #e6e2d8;
  --color-border-dark: #222d3d;
  --color-danger: #d32f2f;
  --color-danger-light: #ffebee;
  --color-success: #2e7d32;
  --color-success-light: #e8f5e9;
  
  /* Gradients */
  --gradient-gold: linear-gradient(135deg, #c9a96e 0%, #e8d5a8 50%, #c9a96e 100%);
  --gradient-primary: linear-gradient(135deg, #1a5c3a 0%, #2d8f5e 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #faf7f2 100%);
  
  /* Fonts */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.12);
  --shadow-gold: 0 4px 25px rgba(201, 169, 110, 0.35);
  
  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--color-bg-main);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   LOGIN VIEW
   ============================================ */
.login-view-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(circle at 50% 20%, #15222e 0%, #0a0e14 100%);
  position: relative;
  overflow: hidden;
}

.login-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
}

.glow-1 {
  width: 450px;
  height: 450px;
  background: rgba(26, 92, 58, 0.3);
  top: -100px;
  left: -100px;
}

.glow-2 {
  width: 400px;
  height: 400px;
  background: rgba(201, 169, 110, 0.2);
  bottom: -80px;
  right: -80px;
}

.login-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 2.8rem 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(201, 169, 110, 0.3);
  animation: cardEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-emblem {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}

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

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

.form-group label .required {
  color: var(--color-danger);
}

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

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

.phone-prefix {
  position: absolute;
  left: 14px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.input-with-icon input {
  padding-left: 44px !important;
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.password-toggle:hover {
  color: var(--color-text);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 0.92rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: #fff;
  color: var(--color-text);
  transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 92, 58, 0.15);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.checkbox-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox-container input {
  accent-color: var(--color-primary);
  width: 16px;
  height: 16px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gradient-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(26, 92, 58, 0.25);
  transition: var(--transition);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #154e31 0%, #267a50 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(26, 92, 58, 0.35);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: #f5f2ea;
  border-color: #d1cbbd;
}

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  color: var(--color-danger);
  font-weight: 500;
  font-size: 0.88rem;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(211, 47, 47, 0.3);
  cursor: pointer;
  transition: var(--transition);
}

.btn-danger-outline:hover {
  background: var(--color-danger-light);
  border-color: var(--color-danger);
}

.btn-text {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}

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

.btn-full {
  width: 100%;
}

.alert-box {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  margin-bottom: 1.2rem;
  background-color: var(--color-danger-light);
  color: var(--color-danger);
  border-left: 3px solid var(--color-danger);
}

.alert-box.shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.login-footer {
  margin-top: 1.8rem;
  text-align: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  text-decoration: none;
  transition: var(--transition);
}

.back-link:hover {
  color: var(--color-primary);
}

/* ============================================
   APP CONTAINER & LAYOUT
   ============================================ */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  background: var(--color-bg-sidebar);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--color-border-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

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

.topbar-brand .brand-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.crm-badge {
  background: rgba(201, 169, 110, 0.18);
  color: var(--color-accent-gold-light);
  border: 1px solid rgba(201, 169, 110, 0.4);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  color: #a0aec0;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: var(--radius-full);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.btn-topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e2e8f0;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  transition: var(--transition);
}

.btn-topbar-link:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: var(--gradient-gold);
  color: #0f161e;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
}

.user-role {
  color: #718096;
  font-size: 0.72rem;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover {
  background: #ef4444;
  color: #fff;
}

/* Dashboard Body */
.dashboard-body {
  display: flex;
  flex: 1;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: var(--color-bg-sidebar);
  border-right: 1px solid var(--color-border-dark);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-nav {
  padding: 1.2rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: var(--transition);
  position: relative;
}

.nav-tab:hover {
  background: var(--color-bg-sidebar-active);
  color: #f1f5f9;
}

.nav-tab.active {
  background: var(--color-bg-sidebar-active);
  color: var(--color-accent-gold-light);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--color-accent-gold);
}

.count-badge {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.count-leads {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.sidebar-footer {
  padding: 1.2rem 1rem;
  border-top: 1px solid var(--color-border-dark);
}

.phone-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 10px;
}

.phone-label {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.phone-value {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #10b981;
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 1300px;
  width: 100%;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

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

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.8rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}

.page-subtitle {
  color: var(--color-text-secondary);
  font-size: 0.92rem;
}

/* ============================================
   KPI CARDS
   ============================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.8rem;
}

.kpi-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 1.1rem;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--color-bg-main);
  flex-shrink: 0;
}

.kpi-data {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 2px;
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--color-text);
}

/* Info Banner */
.info-card {
  background: linear-gradient(135deg, #0e3a24 0%, #1a5c3a 100%);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.8rem;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 24px rgba(14, 58, 36, 0.2);
}

.info-card-content h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
  color: var(--color-accent-gold-light);
}

.info-card-content p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 680px;
}

.info-card-content strong {
  color: #fff;
  text-decoration: underline;
}

/* Section Card */
.section-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.section-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.4rem;
}

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

.recent-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem;
}

.mini-product-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  transition: var(--transition);
}

.mini-product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  border-color: var(--color-accent-gold);
}

.mini-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%;
  background: #f5f2ea;
}

.mini-img-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-info {
  padding: 10px;
}

.mini-category {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 600;
}

.mini-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0 4px;
}

.mini-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* ============================================
   PRODUCTS TABLE & CRUD TOOLBAR
   ============================================ */
.toolbar-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1rem 1.4rem;
  border: 1px solid var(--color-border);
  margin-bottom: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}

.search-box input {
  padding-left: 38px !important;
}

.filter-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-select {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  font-size: 0.88rem;
  background-color: #fff;
  cursor: pointer;
  min-width: 170px;
}

.products-table-wrapper {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.products-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.products-table th {
  background: #faf8f4;
  padding: 13px 16px;
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--color-border);
}

.products-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f0ede6;
  vertical-align: middle;
}

.products-table tr:hover td {
  background-color: #faf9f6;
}

.table-product-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #f5f2ea;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: var(--transition);
}

.table-product-thumb:hover {
  transform: scale(1.1);
}

.table-product-title {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.table-product-desc {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.tag-badge.best-seller {
  background: rgba(26, 92, 58, 0.15);
  color: var(--color-primary);
}

.tag-badge.nuevo {
  background: rgba(201, 169, 110, 0.2);
  color: var(--color-accent-gold-dark);
}

.tag-badge.oferta {
  background: rgba(211, 47, 47, 0.15);
  color: var(--color-danger);
}

.table-price {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.95rem;
}

.table-rating {
  font-size: 0.82rem;
  color: #f59e0b;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-icon-action {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-action:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #f5fbf7;
}

.btn-icon-action.delete-btn:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
  background: var(--color-danger-light);
}

/* ============================================
   CRM LEADS CONTAINER
   ============================================ */
.leads-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lead-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  transition: var(--transition);
}

.lead-card:hover {
  box-shadow: var(--shadow-md);
}

.lead-main {
  flex: 1;
}

.lead-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.4rem;
}

.lead-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
}

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

.lead-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: #e0f2fe;
  color: #0284c7;
}

.lead-email {
  font-size: 0.85rem;
  color: var(--color-primary);
  margin-bottom: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lead-message {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  background: #faf8f5;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-accent-gold);
}

.lead-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--color-border);
  color: var(--color-text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
}

/* ============================================
   SETTINGS VIEW
   ============================================ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.8rem;
}

.settings-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.settings-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--color-text);
}

.settings-card-desc {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.4rem;
}

.help-text {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
}

.backup-actions {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.file-label {
  cursor: pointer;
  text-align: center;
}

.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0.5rem 0;
}

/* ============================================
   PRODUCT CRUD MODAL (Rich Form)
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 20, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

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

.modal-header {
  padding: 1.2rem 1.8rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #faf8f4;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--color-text);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: var(--color-danger);
}

#product-crud-form {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.modal-body-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.8rem;
  padding: 1.8rem;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.form-columns {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Image Selection Tabs & Dropzone */
.image-selection-block {
  background: #faf8f5;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.image-upload-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 6px;
}

.img-tab {
  background: none;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.img-tab.active {
  background: var(--color-primary);
  color: #fff;
}

.img-tab-content {
  display: none;
}

.img-tab-content.active {
  display: block;
}

.file-drop-zone {
  border: 2px dashed #d1cbbd;
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.file-drop-zone:hover {
  border-color: var(--color-primary);
  background: #f6fbf8;
}

.file-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-drop-zone svg {
  color: var(--color-accent-gold);
  margin-bottom: 0.4rem;
}

.file-drop-zone p {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text);
}

.drop-link {
  color: var(--color-primary);
  text-decoration: underline;
}

.file-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.gallery-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
  padding: 4px;
}

.gallery-thumb {
  width: 100%;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid transparent;
  cursor: pointer;
  background: #fff;
  transition: var(--transition);
}

.gallery-thumb:hover {
  transform: scale(1.05);
}

.gallery-thumb.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-accent-gold);
}

/* Live Card Preview Column */
.preview-column {
  border-left: 1px solid var(--color-border);
  padding-left: 1.8rem;
  display: flex;
  flex-direction: column;
}

.preview-column h4 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 0.8rem;
}

.preview-card-wrap {
  width: 100%;
  max-width: 280px;
}

/* Replica of main store card */
.product-card {
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.product-image-container {
  position: relative;
  width: 100%;
  padding-top: 110%;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f5f0, #efe9dd);
}

.product-image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  z-index: 2;
}

.product-badge.best-seller {
  background: var(--color-primary);
  color: #fff;
}

.product-badge.nuevo {
  background: var(--gradient-gold);
  color: #0f161e;
}

.product-badge.oferta {
  background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
  color: #fff;
}

.product-quick-view {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
  display: flex;
  justify-content: center;
}

.quick-view-btn {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  cursor: default;
}

.product-info {
  padding: 12px;
}

.product-category-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-accent-gold-dark);
  font-weight: 700;
  margin-bottom: 2px;
}

.product-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-description {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
  height: 32px;
  overflow: hidden;
  margin-bottom: 8px;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.product-price {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1rem;
}

.product-rating {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 3px;
}

.product-rating .stars {
  color: #c9a96e;
}

.product-order-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 7px;
  background: #25d366;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.modal-footer {
  padding: 1.2rem 1.8rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #faf8f4;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #111827;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 4px solid var(--color-accent-gold);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ============================================
   RESPONSIVENESS
   ============================================ */
@media (max-width: 900px) {
  .modal-body-grid {
    grid-template-columns: 1fr;
  }
  
  .preview-column {
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding-left: 0;
    padding-top: 1.5rem;
    align-items: center;
  }
  
  .sidebar {
    position: fixed;
    top: 64px;
    bottom: 0;
    left: -260px;
    z-index: 90;
    transition: var(--transition);
  }
  
  .sidebar.open {
    left: 0;
    box-shadow: 10px 0 30px rgba(0,0,0,0.4);
  }
  
  .mobile-sidebar-toggle {
    display: block;
  }
  
  .content-area {
    padding: 1.5rem;
  }
}

@media (max-width: 600px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
  
  .topbar {
    padding: 0 1rem;
  }
  
  .crm-badge, .status-indicator, .logout-text, .user-meta {
    display: none;
  }
  
  .lead-card {
    flex-direction: column;
  }
  
  .lead-actions {
    width: 100%;
  }
  
  .info-card {
    flex-direction: column;
    align-items: flex-start;
  }
}
