:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.95);
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;

  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-text: #065f46;

  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-text: #991b1b;

  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-text: #92400e;

  --admin-accent: #7c3aed;
  --admin-bg: #f5f3ff;
  --admin-border: #ddd6fe;

  --whatsapp-color: #25d366;
  --whatsapp-hover: #1ebd5b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

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

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

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

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

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ----------------------------------------------------
   HEADER & NAVBAR
---------------------------------------------------- */
.main-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-header);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

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

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

#total-count-badge {
  font-weight: 700;
  color: var(--primary);
}

/* Search Box */
.search-box {
  flex: 1;
  max-width: 440px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  padding: 10px 36px 10px 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

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

.clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.clear-btn:hover {
  color: var(--text-main);
}

/* Role Switcher */
.role-selector-container {
  display: flex;
  align-items: center;
}

.role-switch {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.role-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.role-btn svg {
  transition: transform var(--transition-fast);
}

.role-btn.active[data-role="client"] {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.role-btn.active[data-role="admin"] {
  background: var(--admin-accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

/* ----------------------------------------------------
   ADMIN CONTROL PANEL
---------------------------------------------------- */
.admin-panel {
  background: var(--admin-bg);
  border-bottom: 2px solid var(--admin-border);
  padding: 16px 20px;
}

.admin-panel-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-title-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--admin-accent);
}

.admin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--admin-accent);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

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

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

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat-card {
  background: #ffffff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-success .stat-num { color: var(--success); }
.stat-warning .stat-num { color: var(--danger); }
.stat-info .stat-num { color: var(--admin-accent); }

/* ----------------------------------------------------
   FILTERS & TOOLBAR
---------------------------------------------------- */
.filters-section {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 20px 0 20px;
}

/* Category Tabs */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.cat-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.cat-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cat-tab.active {
  background: var(--text-main);
  border-color: var(--text-main);
  color: #ffffff;
}

.cat-tab .badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-muted);
}

.cat-tab.active .badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.size-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.size-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.size-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.size-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.size-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.secondary-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.stock-filter-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  user-select: none;
}

.stock-filter-toggle input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-hover);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  transition: all var(--transition-fast);
}

.stock-filter-toggle input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--success);
  border-color: var(--success);
}

.stock-filter-toggle input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.custom-select {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
}

.custom-select:focus {
  border-color: var(--primary);
}

/* ----------------------------------------------------
   CATALOG GRID & CARDS
---------------------------------------------------- */
.catalog-main {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
}

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* Product Card */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  position: relative;
  content-visibility: auto;
  contain-intrinsic-size: 380px;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}

/* Admin badge on card when in admin mode */
.product-card.admin-view {
  border-color: var(--admin-border);
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4.8;
  overflow: hidden;
  background: #f1f5f9;
  cursor: pointer;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .card-media img {
  transform: scale(1.05);
}

/* Media Overlay Badges */
.card-badges-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-category {
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
}

.badge-size {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.badge-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.card-stock-pill {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.card-stock-pill.in-stock {
  background: rgba(16, 185, 129, 0.9);
  color: white;
}

.card-stock-pill.out-of-stock {
  background: rgba(239, 68, 68, 0.9);
  color: white;
}

/* Card Content */
.card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

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

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.card-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

.price-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.price-unassigned {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  font-style: italic;
}

/* Admin Card Actions */
.card-admin-controls {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--admin-bg);
  margin-left: -16px;
  margin-right: -16px;
  margin-bottom: -16px;
  padding: 12px 16px;
}

.stock-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
}

.stock-stepper {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.btn-step {
  width: 28px;
  height: 28px;
  border: none;
  background: #f1f5f9;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-step:hover {
  background: #e2e8f0;
}

.stock-value {
  width: 32px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
}

.btn-card-edit {
  width: 100%;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-accent);
  background: #ffffff;
  color: var(--admin-accent);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-card-edit:hover {
  background: var(--admin-accent);
  color: #ffffff;
}

/* Client Card Button */
.btn-card-view {
  width: 100%;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
  margin: 30px 0;
}

.empty-icon {
  margin-bottom: 16px;
  color: var(--text-light);
}

.empty-state h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

/* ----------------------------------------------------
   BUTTONS & FORM CONTROLS
---------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

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

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

.btn-primary-light {
  background: #ffffff;
  border-color: var(--admin-accent);
  color: var(--admin-accent);
}

.btn-primary-light:hover {
  background: var(--admin-accent);
  color: white;
}

.btn-outline {
  background: white;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--text-main);
}

.btn-whatsapp {
  background: var(--whatsapp-color);
  color: white;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
  font-size: 0.95rem;
}

.btn-whatsapp:hover {
  background: var(--whatsapp-hover);
  color: white;
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary);
}

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

.col-half {
  flex: 1;
}

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

.w-100 {
  width: 100%;
}

/* ----------------------------------------------------
   MODALS (<dialog>)
---------------------------------------------------- */
.modal-dialog {
  border: none;
  background: transparent;
  padding: 20px;
  max-width: 960px;
  width: 100%;
  margin: auto;
  outline: none;
}

.modal-dialog::backdrop {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  position: relative;
  animation: modalEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card-sm {
  max-width: 460px;
  margin: 0 auto;
  padding: 24px;
}

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

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: #f1f5f9;
  transform: rotate(90deg);
}

/* Product Detail Modal Body */
.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 520px;
}

@media (max-width: 768px) {
  .modal-body {
    grid-template-columns: 1fr;
  }
}

.modal-image-col {
  background: #0f172a;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-image-wrapper {
  width: 100%;
  height: 100%;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image-wrapper img {
  max-width: 100%;
  max-height: 600px;
  object-fit: contain;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-arrow:hover {
  background: #ffffff;
  transform: translateY(-50%) scale(1.1);
}

.nav-prev { left: 14px; }
.nav-next { right: 14px; }

.modal-info-col {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  max-height: 620px;
}

.modal-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-name {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
}

.detail-pricing-stock {
  display: flex;
  align-items: center;
  gap: 14px;
}

.price-display {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
}

.stock-status-badge {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
}

.stock-status-badge.in-stock {
  background: var(--success-bg);
  color: var(--success-text);
}

.stock-status-badge.out-of-stock {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.reference-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 14px;
  border-radius: var(--radius-md);
}

.ref-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

.ref-copy-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ref-code {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  background: #e2e8f0;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  background: white;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.copy-btn:hover {
  background: #f1f5f9;
}

.ref-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.client-modal-actions {
  margin-top: auto;
}

/* Admin Lightbox Edit Panel */
.admin-modal-edit-panel {
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-top: 10px;
}

.edit-box-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--admin-accent);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stock-input-counter {
  display: flex;
  align-items: center;
}

.btn-stock-dec, .btn-stock-inc {
  width: 38px;
  height: 42px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-stock-dec {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  border-right: none;
}

.btn-stock-inc {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-left: none;
}

.stock-input-counter input {
  border-radius: 0;
  height: 42px;
}

/* Edit Modal Preview Thumbnail */
.form-thumb-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 10px;
  background: #f8fafc;
  border-radius: var(--radius-md);
}

.form-thumb-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.thumb-meta {
  display: flex;
  gap: 6px;
}

.modal-header-simple {
  margin-bottom: 16px;
}

.modal-header-simple h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-header-simple p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ----------------------------------------------------
   TOAST NOTIFICATIONS
---------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s ease;
  pointer-events: auto;
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-info {
  border-left: 4px solid var(--primary);
}

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

/* ----------------------------------------------------
   FOOTER
---------------------------------------------------- */
.main-footer {
  text-align: center;
  padding: 24px;
  color: var(--text-light);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
  margin-top: 40px;
}

/* ----------------------------------------------------
   CATEGORY GROUPED BOXES ("cuadrado o contenedor por tipo")
---------------------------------------------------- */
.catalog-groups-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.category-group-box {
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  position: relative;
  transition: border-color var(--transition-normal);
}

.category-group-box:hover {
  border-color: #cbd5e1;
}

.category-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
}

.category-group-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-group-emoji {
  font-size: 1.8rem;
  line-height: 1;
}

.category-group-titles {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.category-group-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.category-group-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.category-group-sizes {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.size-tag-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.size-tag-pill {
  font-size: 0.75rem;
  font-weight: 700;
  background: #f1f5f9;
  color: var(--text-main);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* ----------------------------------------------------
   ADMIN LOGIN VIEW
---------------------------------------------------- */
.admin-body {
  background-color: var(--bg-body);
  min-height: 100vh;
}

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background-color: #0f172a;
}

.login-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  max-width: 420px;
  width: 100%;
  padding: 36px 30px;
  animation: modalEnter 0.3s ease;
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-shield-icon {
  width: 58px;
  height: 58px;
  background: #f5f3ff;
  color: var(--admin-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px auto;
  border: 2px solid var(--admin-border);
}

.login-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.login-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.pass-input-wrapper input {
  padding-right: 42px;
}

.toggle-pass-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.pass-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 6px;
}

.login-alert {
  background: var(--danger-bg);
  color: var(--danger-text);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  border-left: 4px solid var(--danger);
}

.btn-lg {
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 700;
}

.login-footer-links {
  text-align: center;
  margin-top: 20px;
}

.link-back-catalog {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}

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

/* Admin Header & Controls */
.admin-badge-icon {
  background: linear-gradient(135deg, var(--admin-accent), #a855f7);
}

.admin-user-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-danger-light {
  background: white;
  border-color: #fca5a5;
  color: var(--danger);
}

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

.badge-warning-pill {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--warning-text);
  background: var(--warning-bg);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* ----------------------------------------------------
   RESPONSIVE QUERIES
---------------------------------------------------- */
@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: 100%;
  }

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

  .category-group-box {
    padding: 14px;
  }

  .card-content {
    padding: 10px;
  }

  .price-text {
    font-size: 1rem;
  }
}

