/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
  font-size: 14px;
  color: #1D1D1F;
  background: #F5F5F7;
  -webkit-font-smoothing: antialiased;
}

/* Logo */
.logo-cube {
  width: 28px; height: 28px;
  background: #26B5DC;
  clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%);
  flex-shrink: 0;
}
.logo-cube.small { width: 22px; height: 22px; }
.logo-text { font-weight: 800; font-size: 16px; color: #0D1929; letter-spacing: -0.5px; }
.logo-accent { color: #26B5DC; }

/* === LOGIN PAGE === */
.login-page {
  background: linear-gradient(135deg, #FAFAFA 0%, #E8F4F9 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-container { width: 100%; max-width: 420px; }
.login-card {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 48px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  justify-content: center;
}
.login-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: #1D1D1F;
}
.login-subtitle {
  font-size: 14px;
  color: #86868B;
  text-align: center;
  margin-bottom: 32px;
}
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #E0E0E0;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
}
.login-form input:focus {
  outline: none;
  border-color: #26B5DC;
}
.login-form button {
  padding: 14px;
  background: #26B5DC;
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.login-form button:hover { background: #1FA0C4; }
.login-form button:disabled { opacity: 0.6; cursor: not-allowed; }
.error-message {
  color: #E53E3E;
  font-size: 13px;
  text-align: center;
  min-height: 20px;
}
.login-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 12px;
  color: #86868B;
}

/* === APP LAYOUT === */
#app {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "header header"
    "sidebar main";
  height: 100vh;
}
.app-loading { opacity: 0.5; pointer-events: none; }

/* Header */
.app-header {
  grid-area: header;
  background: #FFFFFF;
  border-bottom: 1px solid #E5E5E7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-title { font-weight: 600; font-size: 15px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-time {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: #86868B;
  font-weight: 500;
}
.btn-text {
  background: none;
  border: none;
  color: #86868B;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
}
.btn-text:hover { background: #F5F5F7; color: #1D1D1F; }

/* Sidebar */
.app-sidebar {
  grid-area: sidebar;
  background: #FAFAFA;
  border-right: 1px solid #E5E5E7;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.sidebar-nav { display: flex; flex-direction: column; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: #4A4A4A;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}
.nav-item:hover:not(.disabled) {
  background: #F0F0F0;
  color: #1D1D1F;
}
.nav-item.active {
  background: #E8F4F9;
  color: #1FA0C4;
  border-left-color: #26B5DC;
  font-weight: 600;
}
.nav-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.nav-icon {
  font-family: "JetBrains Mono", monospace;
  color: #26B5DC;
  font-size: 14px;
}

/* Sidebar footer */
.sidebar-footer { padding: 16px 20px; }
.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #FFFFFF;
  border: 1px solid #E5E5E7;
  border-radius: 6px;
  font-size: 11px;
  color: #4A4A4A;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #86868B;
}
.status-badge.active .status-dot { background: #34C759; }

/* Main content */
.app-main {
  grid-area: main;
  overflow-y: auto;
  padding: 28px 32px;
}
.section { display: none; }
.section.active { display: block; }
.section-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.section-subtitle {
  color: #86868B;
  font-size: 14px;
  margin-bottom: 24px;
}
.section-h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 28px 0 12px;
  color: #1D1D1F;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.stat-card {
  background: #FFFFFF;
  border: 1px solid #E5E5E7;
  border-radius: 10px;
  padding: 16px 18px;
}
.stat-label {
  font-size: 12px;
  color: #86868B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #1D1D1F;
  line-height: 1;
  letter-spacing: -1px;
}
.stat-detail {
  font-size: 11px;
  color: #86868B;
  margin-top: 6px;
}

/* Cards generic */
.card {
  background: #FFFFFF;
  border: 1px solid #E5E5E7;
  border-radius: 10px;
  overflow: hidden;
}

/* Schedule item */
.schedule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid #F0F0F0;
  font-size: 13px;
}
.schedule-item:last-child { border-bottom: none; }
.schedule-time {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  color: #1D1D1F;
  min-width: 70px;
}
.schedule-platform {
  flex: 1;
  margin-left: 12px;
  color: #4A4A4A;
}
.schedule-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.schedule-status.upcoming { background: #E8F4F9; color: #1FA0C4; }
.schedule-status.passed { background: #F5F5F7; color: #86868B; }

/* Publication item */
.pub-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid #F0F0F0;
}
.pub-item:last-child { border-bottom: none; }
.pub-thumb {
  width: 50px; height: 50px;
  border-radius: 8px;
  background: #F5F5F7;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}
.pub-info { flex: 1; min-width: 0; }
.pub-title {
  font-weight: 500;
  font-size: 13px;
  color: #1D1D1F;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pub-meta {
  font-size: 11px;
  color: #86868B;
  margin-top: 2px;
}
.pub-platform {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
}
.pub-platform.instagram_feed { background: #FCE7F3; color: #BE185D; }
.pub-platform.facebook { background: #DBEAFE; color: #1E40AF; }
.pub-platform.instagram_story { background: #FEF3C7; color: #92400E; }

/* Loading state */
.empty-state {
  padding: 32px;
  text-align: center;
  color: #86868B;
  font-size: 13px;
}

/* === FILTROS === */
.filters-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.filter-input, .filter-select {
  padding: 9px 12px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #FFFFFF;
}
.filter-input { flex: 1; min-width: 200px; }
.filter-select { min-width: 150px; cursor: pointer; }
.filter-input:focus, .filter-select:focus {
  outline: none;
  border-color: #26B5DC;
}

/* === TABLA DE PRODUCTOS === */
.products-table-card { padding: 0; }
.products-table-header {
  display: grid;
  grid-template-columns: 50px 1fr 130px 100px 130px 200px;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #E5E5E7;
  font-size: 11px;
  color: #86868B;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.product-row {
  display: grid;
  grid-template-columns: 50px 1fr 130px 100px 130px 200px;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #F0F0F0;
  align-items: center;
  font-size: 13px;
  transition: background 0.1s;
}
.product-row:hover { background: #FAFBFC; }
.product-row:last-child { border-bottom: none; }
.product-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #F5F5F7 center/cover no-repeat;
  flex-shrink: 0;
}
.product-name {
  font-weight: 500;
  color: #1D1D1F;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-name-row {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.product-brand {
  font-size: 11px;
  color: #86868B;
}
.product-cat {
  color: #4A4A4A;
  font-size: 12px;
}
.product-price {
  font-weight: 500;
  color: #1D1D1F;
  font-size: 12px;
}
.product-ads {
  font-size: 11px;
  font-weight: 600;
}
.product-ads.with { color: #34C759; }
.product-ads.without { color: #86868B; }
.product-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.btn-sm {
  padding: 5px 11px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #E0E0E0;
  background: #FFFFFF;
  color: #4A4A4A;
  transition: all 0.15s;
}
.btn-sm:hover { background: #F5F5F7; border-color: #C8C8C8; }
.btn-sm.primary {
  background: #26B5DC;
  color: #FFFFFF;
  border-color: #26B5DC;
}
.btn-sm.primary:hover { background: #1FA0C4; }
.products-loadmore {
  text-align: center;
  padding: 14px;
  color: #86868B;
  font-size: 12px;
}
.products-loadmore button {
  padding: 8px 18px;
  border: 1px solid #E0E0E0;
  background: #FFFFFF;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: #1D1D1F;
}

/* Badges de estado */
.product-badges {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
}
.product-badge {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.product-badge.new { background: #E8F4F9; color: #1FA0C4; }
.product-badge.sale { background: #FEE2E2; color: #DC2626; }

/* === MODAL === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.modal-overlay.active { display: flex; }
.modal-card {
  background: #FFFFFF;
  border-radius: 14px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.2);
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  background: #F5F5F7;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  z-index: 10;
  color: #86868B;
}
.modal-close:hover { background: #E5E5E7; }

/* Modal product detail */
.modal-product-header {
  display: flex;
  gap: 18px;
  padding: 24px;
  border-bottom: 1px solid #E5E5E7;
}
.modal-product-image {
  width: 120px; height: 120px;
  border-radius: 10px;
  background: #F5F5F7 center/cover no-repeat;
  flex-shrink: 0;
}
.modal-product-info { flex: 1; }
.modal-product-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}
.modal-product-meta {
  font-size: 13px;
  color: #4A4A4A;
  margin-bottom: 4px;
}
.modal-product-price {
  font-size: 22px;
  font-weight: 700;
  color: #1D1D1F;
  margin-top: 8px;
}
.modal-section {
  padding: 18px 24px;
  border-bottom: 1px solid #E5E5E7;
}
.modal-section:last-child { border-bottom: none; }
.modal-section-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #1D1D1F;
}

/* Galería de anuncios */
.ads-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.ad-card {
  border: 1px solid #E5E5E7;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}
.ad-card-image {
  width: 100%;
  aspect-ratio: 1;
  background: #F5F5F7 center/contain no-repeat;
}
.ad-card-image.story { aspect-ratio: 9/16; }
.ad-card-image.whatsapp { aspect-ratio: 4/5; }
.ad-card-info {
  padding: 8px 10px;
  font-size: 11px;
  color: #4A4A4A;
}
.ad-card-format {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #1FA0C4;
}
.ad-card-actions {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  border-top: 1px solid #F0F0F0;
}

/* === CONFIRM MODAL === */
.confirm-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.confirm-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}
.confirm-message {
  font-size: 13px;
  color: #4A4A4A;
  line-height: 1.5;
  margin-bottom: 20px;
}
.confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.btn-primary, .btn-secondary {
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: #26B5DC;
  color: #FFFFFF;
  border-color: #26B5DC;
}
.btn-primary:hover { background: #1FA0C4; }
.btn-primary.danger { background: #DC2626; border-color: #DC2626; }
.btn-primary.danger:hover { background: #B91C1C; }
.btn-secondary {
  background: #FFFFFF;
  color: #4A4A4A;
  border-color: #E0E0E0;
}
.btn-secondary:hover { background: #F5F5F7; }

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1D1D1F;
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  pointer-events: none;
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.success { background: #16A34A; }
.toast.error { background: #DC2626; }



/* === CATEGORY GRID === */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.category-card {
  background: #FFFFFF;
  border: 1px solid #E5E5E7;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
}
.category-card:hover {
  border-color: #26B5DC;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.category-card.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.category-card.disabled:hover {
  transform: none;
  border-color: #E5E5E7;
  box-shadow: none;
}
.category-preview {
  width: 100%;
  aspect-ratio: 1;
  background: #F5F5F7 center/cover no-repeat;
  position: relative;
}
.category-preview.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #C8C8C8;
  font-size: 36px;
  background: linear-gradient(135deg, #FAFAFA 0%, #F0F0F0 100%);
}
.category-preview-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.95);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: #1D1D1F;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.category-info {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.category-name {
  font-size: 16px;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 4px;
}
.category-meta {
  font-size: 12px;
  color: #86868B;
  margin-bottom: 10px;
}
.category-stats {
  display: flex;
  gap: 14px;
  font-size: 11px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #F0F0F0;
}
.category-stat {
  display: flex;
  flex-direction: column;
}
.category-stat-label {
  color: #86868B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 9px;
}
.category-stat-value {
  font-weight: 600;
  color: #1D1D1F;
  margin-top: 2px;
}
.category-status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.category-status-pill.ready { background: #DCFCE7; color: #16A34A; }
.category-status-pill.empty { background: #F5F5F7; color: #86868B; }
.category-status-pill.disabled { background: #FEF3C7; color: #92400E; }

/* Modal de categoría · grid de productos */
.modal-products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.modal-product-mini {
  background: #FAFAFA;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.modal-product-mini-img {
  width: 100%;
  aspect-ratio: 1;
  background: #FFFFFF center/contain no-repeat;
  border-radius: 6px;
  margin-bottom: 8px;
}
.modal-product-mini-name {
  font-size: 11px;
  font-weight: 500;
  color: #1D1D1F;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-product-mini-price {
  font-size: 11px;
  color: #86868B;
}


/* === PUBLICACIONES === */
.pubs-stats {
  margin-bottom: 16px;
}
.pubs-stats .stat-card {
  padding: 12px 14px;
}
.pubs-stats .stat-value {
  font-size: 22px;
}

.pub-row {
  display: grid;
  grid-template-columns: 60px 1fr 130px 110px 130px 100px;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid #F0F0F0;
  align-items: center;
  font-size: 13px;
  transition: background 0.1s;
}
.pub-row:hover { background: #FAFBFC; }
.pub-row:last-child { border-bottom: none; }
.pub-thumb-img {
  width: 50px;
  height: 50px;
  border-radius: 7px;
  background: #F5F5F7 center/cover no-repeat;
  flex-shrink: 0;
}
.pub-content {
  min-width: 0;
}
.pub-content-title {
  font-weight: 500;
  color: #1D1D1F;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.pub-content-headline {
  font-size: 11px;
  color: #86868B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pub-meta-info {
  font-size: 11px;
  color: #4A4A4A;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pub-meta-info .pub-date {
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
}
.pub-meta-info .pub-tag {
  font-size: 10px;
  color: #86868B;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pub-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}
.pub-status.published { background: #DCFCE7; color: #16A34A; }
.pub-status.failed { background: #FEE2E2; color: #DC2626; }
.pub-status.pending { background: #FEF3C7; color: #92400E; }
.pub-row .pub-platform {
  font-size: 10px;
  padding: 4px 8px;
}
.pub-actions-cell {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* Header tabla publicaciones */
.pubs-table-header {
  display: grid;
  grid-template-columns: 60px 1fr 130px 110px 130px 100px;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid #E5E5E7;
  font-size: 11px;
  color: #86868B;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === CALENDAR === */
.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}
.schedule-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.calendar-card {
  padding: 0;
  overflow: hidden;
}

.calendar-days-header {
  display: grid;
  grid-template-columns: 70px repeat(7, 1fr);
  border-bottom: 1px solid #E5E5E7;
  background: #FAFAFA;
}
.calendar-day-header {
  padding: 12px 8px;
  text-align: center;
  border-left: 1px solid #F0F0F0;
}
.calendar-day-header:first-child { border-left: none; }
.calendar-day-header.today {
  background: #E8F4F9;
}
.calendar-day-name {
  font-size: 11px;
  font-weight: 600;
  color: #86868B;
  letter-spacing: 0.5px;
}
.calendar-day-header.today .calendar-day-name { color: #1FA0C4; }
.calendar-day-number {
  font-size: 18px;
  font-weight: 700;
  color: #1D1D1F;
  margin: 4px 0 2px;
}
.calendar-day-header.today .calendar-day-number { color: #1FA0C4; }
.calendar-day-type {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
}
.calendar-day-type.product { color: #26B5DC; }
.calendar-day-type.category { color: #9333EA; }

.calendar-row {
  display: grid;
  grid-template-columns: 70px repeat(7, 1fr);
  border-bottom: 1px solid #F0F0F0;
  min-height: 80px;
}
.calendar-row:last-child { border-bottom: none; }
.calendar-time {
  padding: 14px 10px;
  text-align: right;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: #86868B;
  font-weight: 600;
  background: #FAFAFA;
  border-right: 1px solid #E5E5E7;
}

.calendar-cell {
  padding: 6px;
  border-left: 1px solid #F0F0F0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.calendar-cell:first-of-type { border-left: none; }

.calendar-slot {
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: default;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.calendar-slot.published {
  background: #DCFCE7;
  color: #16A34A;
  cursor: pointer;
}
.calendar-slot.published:hover {
  background: #BBF7D0;
  border-color: #16A34A;
}
.calendar-slot.failed {
  background: #FEE2E2;
  color: #DC2626;
  cursor: pointer;
}
.calendar-slot.upcoming {
  background: #E8F4F9;
  color: #1FA0C4;
}
.calendar-slot.empty {
  background: #F5F5F7;
  color: #C8C8C8;
}
.calendar-slot-thumb {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: #FFFFFF center/cover no-repeat;
  flex-shrink: 0;
}
.calendar-slot-platform {
  font-size: 13px;
  flex-shrink: 0;
}
.calendar-slot-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.calendar-legend {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  padding: 12px 16px;
  background: #FFFFFF;
  border: 1px solid #E5E5E7;
  border-radius: 8px;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #4A4A4A;
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.legend-dot.published { background: #DCFCE7; border: 1px solid #16A34A; }
.legend-dot.failed { background: #FEE2E2; border: 1px solid #DC2626; }
.legend-dot.upcoming { background: #E8F4F9; border: 1px solid #1FA0C4; }
.legend-dot.empty { background: #F5F5F7; border: 1px solid #C8C8C8; }

/* Responsive: vista compacta en móvil */
@media (max-width: 900px) {
  .calendar-slot-label { display: none; }
  .calendar-day-name { font-size: 10px; }
  .calendar-time { font-size: 10px; padding: 10px 5px; }
}

/* === SETTINGS === */
.settings-card {
  background: #FFFFFF;
  border: 1px solid #E5E5E7;
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 14px;
}
.settings-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.settings-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 4px;
}
.settings-card-desc {
  font-size: 12px;
  color: #86868B;
  margin-bottom: 14px;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #C8C8C8;
  border-radius: 999px;
  transition: 0.2s;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background: #34C759;
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* Time tags */
.time-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  min-height: 36px;
}
.time-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
}
.time-tag.instagram { background: #FCE7F3; color: #BE185D; }
.time-tag.facebook { background: #DBEAFE; color: #1E40AF; }
.time-tag-remove {
  cursor: pointer;
  opacity: 0.6;
  font-size: 16px;
  line-height: 1;
  background: none;
  border: none;
  color: inherit;
  padding: 0;
}
.time-tag-remove:hover { opacity: 1; }

.time-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.time-input {
  padding: 7px 12px;
  border: 1px solid #E0E0E0;
  border-radius: 6px;
  font-size: 13px;
  font-family: "JetBrains Mono", monospace;
}
.time-input:focus {
  outline: none;
  border-color: #26B5DC;
}

.settings-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.settings-label {
  font-size: 12px;
  font-weight: 600;
  color: #4A4A4A;
  margin-bottom: 6px;
  display: block;
}

.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #E5E5E7;
}

.empty-times {
  padding: 14px;
  text-align: center;
  color: #C8C8C8;
  font-size: 12px;
  font-style: italic;
  width: 100%;
}

/* === REVIEW SYSTEM === */
.nav-badge {
  background: #DC2626;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: auto;
  min-width: 22px;
  text-align: center;
}

.review-stats {
  background: #FFFFFF;
  border: 1px solid #E5E5E7;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 13px;
  color: #4A4A4A;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.review-card {
  background: #FFFFFF;
  border: 1px solid #E5E5E7;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}
.review-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.review-card-img {
  width: 100%;
  aspect-ratio: 1;
  background: #FAFAFA;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}
.review-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.review-card-info {
  padding: 12px 14px;
}
.review-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  min-height: 2.6em;
}
.review-card-meta {
  font-size: 11px;
  color: #86868B;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}
.review-card-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.review-card-badge.new { background: #DBEAFE; color: #1E40AF; }
.review-card-badge.sale { background: #FEE2E2; color: #991B1B; }

.review-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px 14px;
}
.btn-approve, .btn-reject {
  flex: 1;
  padding: 9px 0;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-approve {
  background: #16A34A;
  color: white;
}
.btn-approve:hover { background: #15803D; }
.btn-reject {
  background: #DC2626;
  color: white;
}
.btn-reject:hover { background: #B91C1C; }
.btn-approve:disabled, .btn-reject:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Image zoom modal */
.img-zoom-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: zoom-out;
}
.img-zoom-overlay img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

/* Reject modal */
.reject-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}
.reject-modal-content {
  background: white;
  border-radius: 12px;
  padding: 22px;
  width: 90%;
  max-width: 420px;
}
.reject-modal h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
}
.reject-modal textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 70px;
  margin-bottom: 14px;
}
.reject-modal label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #4A4A4A;
  margin-bottom: 16px;
  cursor: pointer;
}
.reject-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* === MARKED PRODUCTS === */
.marked-stats {
  background: #FFFFFF;
  border: 1px solid #E5E5E7;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 13px;
  color: #4A4A4A;
}

.marked-table-wrap {
  background: #FFFFFF;
  border: 1px solid #E5E5E7;
  border-radius: 12px;
  overflow: hidden;
}

.marked-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.marked-table thead th {
  background: #FAFAFA;
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: #4A4A4A;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #E5E5E7;
}

.marked-table tbody tr {
  border-bottom: 1px solid #F0F0F0;
  transition: background 0.15s;
}
.marked-table tbody tr:hover { background: #FAFAFA; }
.marked-table tbody tr:last-child { border-bottom: none; }

.marked-table td {
  padding: 12px 16px;
  vertical-align: middle;
}

.marked-thumb {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: contain;
  background: #FAFAFA;
  border: 1px solid #E5E5E7;
  cursor: zoom-in;
}

.marked-product-name {
  font-weight: 600;
  color: #1D1D1F;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.marked-product-brand {
  font-size: 11px;
  color: #86868B;
}

.marked-ads-count {
  display: inline-flex;
  gap: 6px;
  font-size: 11px;
}
.marked-ad-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.marked-ad-pill.approved { background: #DCFCE7; color: #16A34A; }
.marked-ad-pill.pending { background: #FEF3C7; color: #92400E; }
.marked-ad-pill.rejected { background: #FEE2E2; color: #991B1B; }

.marked-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.btn-tiny {
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.btn-tiny.primary { background: #26B5DC; color: white; }
.btn-tiny.primary:hover { background: #1F9BC0; }
.btn-tiny.secondary { background: #F0F0F0; color: #4A4A4A; }
.btn-tiny.secondary:hover { background: #E0E0E0; }
.btn-tiny:disabled { opacity: 0.5; cursor: not-allowed; }

/* Botón Sync sin @imgly (verde) */
.btn-tiny.success {
  background: #16A34A;
  color: white;
}
.btn-tiny.success:hover {
  background: #15803D;
}

/* === EDITOR DE DISEÑO === */
.design-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid #E5E5E7;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.design-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #4A4A4A;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16A34A;
}
.status-dot.draft { background: #F97316; }
.status-dot.modified { background: #F97316; animation: pulse 1.5s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.design-buttons {
  display: flex;
  gap: 8px;
}

.btn-primary, .btn-secondary, .btn-success {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary { background: #26B5DC; color: white; }
.btn-primary:hover { background: #1F9BC0; }
.btn-secondary { background: #F0F0F0; color: #4A4A4A; }
.btn-secondary:hover { background: #E0E0E0; }
.btn-success { background: #16A34A; color: white; }
.btn-success:hover { background: #15803D; }
.btn-primary:disabled, .btn-success:disabled, .btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.design-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.design-card {
  background: #FFFFFF;
  border: 1px solid #E5E5E7;
  border-radius: 12px;
  padding: 20px;
}
.design-card-wide { grid-column: span 2; }

.design-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F0F0F0;
}

.design-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  gap: 12px;
}

.design-field-label {
  font-size: 13px;
  color: #4A4A4A;
  flex: 1;
}

.design-color-input {
  width: 32px;
  height: 32px;
  border: 1px solid #E0E0E0;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  background: transparent;
}

.design-color-hex {
  font-family: monospace;
  font-size: 11px;
  color: #86868B;
  width: 70px;
  text-align: right;
}

.design-font-select {
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid #E0E0E0;
  border-radius: 6px;
  background: white;
  min-width: 140px;
}

.design-size-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.design-size-label {
  flex: 1;
  font-size: 12px;
  color: #4A4A4A;
}
.design-size-slider {
  width: 120px;
}
.design-size-value {
  font-family: monospace;
  font-size: 11px;
  color: #1D1D1F;
  width: 40px;
  text-align: right;
  font-weight: 600;
}

.design-sizes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* === FONDOS Y TEXTURAS === */
.bg-section {
  margin-bottom: 20px;
}
.bg-section:last-child {
  margin-bottom: 0;
}

.bg-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #F0F0F0;
}

.bg-controls-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

.bg-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bg-control-label {
  font-size: 12px;
  color: #4A4A4A;
  font-weight: 500;
}
.bg-control-input {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bg-control-input .design-color-input {
  width: 30px;
  height: 30px;
}
.bg-control-input .design-color-hex {
  font-size: 11px;
}

.bg-opacity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.bg-opacity-label {
  flex: 1;
  font-size: 12px;
  color: #4A4A4A;
}
.bg-opacity-slider {
  width: 140px;
}
.bg-opacity-value {
  font-family: monospace;
  font-size: 11px;
  color: #1D1D1F;
  width: 40px;
  text-align: right;
  font-weight: 600;
}

.texture-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.texture-option {
  cursor: pointer;
  border: 2px solid #E0E0E0;
  border-radius: 8px;
  padding: 6px;
  background: white;
  transition: all 0.15s;
  text-align: center;
}
.texture-option:hover {
  border-color: #26B5DC80;
}
.texture-option.selected {
  border-color: #26B5DC;
  background: #E0F4FB;
}

.texture-preview {
  width: 100%;
  height: 50px;
  border-radius: 4px;
  background: #FAFAFA;
  position: relative;
  overflow: hidden;
  margin-bottom: 4px;
  border: 1px solid #F0F0F0;
}
.texture-preview svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.7;
}

.texture-name {
  font-size: 10px;
  font-weight: 600;
  color: #4A4A4A;
}

/* =====================================================
   RESPONSIVE - MOBILE FIRST
   ===================================================== */

/* === BOTÓN HAMBURGUESA === */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-right: 12px;
}
.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: #1D1D1F;
  border-radius: 2px;
  transition: all 0.2s;
}

/* === OVERLAY === */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}
.sidebar-overlay.open {
  display: block;
}

/* =====================================================
   📱 MOBILE (< 768px)
   ===================================================== */
@media (max-width: 1023px) {
  
  /* HAMBURGUESA visible */
  .hamburger-btn {
    display: flex;
  }
  
  /* HEADER ajustes */
  header {
    padding: 0 12px;
  }
  .brand {
    font-size: 14px;
  }
  .brand-diamond {
    width: 18px;
    height: 18px;
  }
  
  /* SIDEBAR como drawer */
  aside {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 999;
    box-shadow: 2px 0 12px rgba(0,0,0,0.1);
  }
  aside.open {
    transform: translateX(0);
  }
  
  /* CONTENT full width */
  main {
    margin-left: 0 !important;
    padding: 16px 12px !important;
  }
  
  /* TÍTULOS más compactos */
  .section-title {
    font-size: 20px;
  }
  .section-subtitle {
    font-size: 13px;
  }
  
  /* DASHBOARD stats: 4 cols → 2 cols */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .stat-card {
    padding: 14px !important;
  }
  .stat-value {
    font-size: 24px !important;
  }
  .stat-label {
    font-size: 10px !important;
  }
  .stat-detail {
    font-size: 11px !important;
  }
  
  /* GRIDS genéricos: 1 columna */
  .products-grid,
  .categories-grid,
  .design-grid,
  .review-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  /* CARDS más compactas */
  .product-card,
  .category-card,
  .design-card {
    padding: 14px !important;
  }
  
  /* REVISIÓN: cards 1 columna */
  .review-card {
    max-width: 100% !important;
  }
  
  /* MARCADOS: tabla → cards */
  .marked-table thead {
    display: none;
  }
  .marked-table,
  .marked-table tbody,
  .marked-table tr,
  .marked-table td {
    display: block;
    width: 100%;
  }
  .marked-table tr {
    background: white;
    border: 1px solid #E5E5E7;
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 12px;
  }
  .marked-table td {
    padding: 6px 0 !important;
    border: none !important;
    text-align: left !important;
  }
  .marked-table td:before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    color: #86868B;
    text-transform: uppercase;
    margin-bottom: 2px;
    font-weight: 600;
  }
  .marked-thumb {
    width: 80px !important;
    height: 80px !important;
  }
  .marked-actions {
    flex-direction: column;
    gap: 6px !important;
    margin-top: 8px;
  }
  .btn-tiny {
    width: 100%;
    text-align: center;
  }
  
  /* MODAL DE RECHAZO */
  .reject-modal-content {
    width: 92% !important;
    max-width: 380px !important;
    margin: 20px;
  }
  
  /* DISEÑO: ajustes */
  .design-card-wide {
    grid-column: span 1 !important;
  }
  .design-sizes-grid {
    grid-template-columns: 1fr !important;
  }
  .design-toolbar {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px;
  }
  .design-buttons {
    flex-direction: column;
  }
  .design-buttons button {
    width: 100%;
  }
  .bg-controls-row {
    grid-template-columns: 1fr !important;
  }
  .texture-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  
  /* PROGRAMACIÓN: layout vertical */
  .schedule-grid,
  .config-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* SCHEDULER status en sidebar */
  .scheduler-status {
    font-size: 11px;
  }
  
  /* PUBLICACIONES: cards en lugar de tabla */
  .publications-list {
    overflow-x: hidden;
  }
  
  /* TOAST en mobile: full width */
  .toast {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
  }
}

/* =====================================================
   💻 TABLET (768px - 1023px)
   ===================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
  
  /* SIDEBAR compacto */
  aside {
    width: 200px;
  }
  main {
    margin-left: 200px;
  }
  
  /* DASHBOARD stats: 4 cols → 2 cols */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* DESIGN grid: 2 cols (igual que desktop) */
  .design-grid {
    grid-template-columns: 1fr 1fr;
  }
  .design-sizes-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  /* REVIEW: 2 columnas */
  .review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  
  /* PRODUCTOS: 2-3 columnas según ancho */
  .products-grid,
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  
  /* TEXTURAS: 4 cols */
  .texture-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* === FIX EXTRA RESPONSIVE MOBILE === */
@media (max-width: 1023px) {
  
  /* Forzar layout limpio en móvil */
  body {
    overflow-x: hidden;
  }
  
  /* Buscar todos los posibles selectores de sidebar */
  aside,
  nav.sidebar,
  .app-nav,
  .sidebar,
  #sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    width: 260px !important;
    transform: translateX(-100%) !important;
    transition: transform 0.25s ease !important;
    z-index: 999 !important;
    box-shadow: 2px 0 12px rgba(0,0,0,0.1) !important;
    margin: 0 !important;
  }
  
  aside.open,
  nav.sidebar.open,
  .app-nav.open,
  .sidebar.open,
  #sidebar.open {
    transform: translateX(0) !important;
  }
  
  /* Main: full width sin margin del sidebar */
  main,
  .app-main,
  .main-content,
  #main,
  .content {
    margin-left: 0 !important;
    padding: 16px 12px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* App layout grid: hacerlo 1 columna */
  .app-layout,
  .app-container,
  .app-body {
    grid-template-columns: 1fr !important;
    display: block !important;
  }
  
  /* Tablas con scroll horizontal */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    white-space: nowrap;
  }
  
  /* Filtros: full width y stack vertical */
  .filters,
  .filter-bar,
  .filters-row {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .filters input,
  .filters select,
  .filter-bar input,
  .filter-bar select {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* === FIX RESPONSIVE MÓVIL · SELECTORES CORRECTOS === */
@media (max-width: 1023px) {
  
  /* App layout container: pasar de grid/flex a block */
  body {
    overflow-x: hidden !important;
  }
  
  /* Cualquier contenedor parent del aside+main → quitar grid */
  body > div,
  body > .app-shell,
  body > .app-container,
  body > .app-layout {
    display: block !important;
    grid-template-columns: none !important;
  }
  
  /* SIDEBAR específico */
  aside.app-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    width: 260px !important;
    transform: translateX(-100%) !important;
    transition: transform 0.25s ease !important;
    z-index: 999 !important;
    box-shadow: 2px 0 12px rgba(0,0,0,0.15) !important;
    margin: 0 !important;
    overflow-y: auto !important;
  }
  
  aside.app-sidebar.open {
    transform: translateX(0) !important;
  }
  
  /* MAIN específico */
  main.app-main {
    margin-left: 0 !important;
    padding: 16px 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    grid-column: 1 / -1 !important;
  }
  
  /* Tablas con scroll horizontal */
  table {
    width: 100%;
    table-layout: auto;
  }
  
  .products-table-wrap,
  .table-wrap,
  .marked-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}











/* =====================================================
   FIX NUCLEAR MODALES - aplicado al final
   ===================================================== */
html body #confirm-overlay:not(.active),
html body #modal-overlay:not(.active) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  z-index: -1 !important;
}

html body #confirm-overlay.active,
html body #modal-overlay.active {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  z-index: 1000 !important;
}

/* =====================================================
   FIX VISTAS MÓVIL: Productos, Publicaciones, Programación
   ===================================================== */
@media (max-width: 1023px) {
  
  /* Cualquier contenedor que tenga tabla → scroll horizontal */
  .products-list,
  .products-table-wrap,
  .publications-list,
  .publications-table-wrap,
  .table-wrap,
  .table-container,
  .schedule-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
  }
  
  /* Forzar tablas a no exceder pero permitir scroll del wrap */
  .products-list table,
  .publications-list table {
    min-width: 600px;  /* Permite scroll si es necesario */
    width: 100%;
  }
  
  /* CALENDARIO de programación: scroll horizontal */
  .schedule-grid,
  .week-grid,
  .calendar-grid {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    display: block !important;
  }
  
  /* Indicador visual de scroll: sombra derecha sutil */
  .products-list,
  .publications-list,
  .schedule-grid {
    background-image: linear-gradient(to right, white, white),
                      linear-gradient(to right, white, white),
                      linear-gradient(to right, rgba(0,0,0,0.08), rgba(255,255,255,0)),
                      linear-gradient(to left, rgba(0,0,0,0.08), rgba(255,255,255,0));
    background-position: left center, right center, left center, right center;
    background-repeat: no-repeat;
    background-color: white;
    background-size: 20px 100%, 20px 100%, 10px 100%, 10px 100%;
    background-attachment: local, local, scroll, scroll;
  }
  
  /* PROGRAMACIÓN: hacer cards de día más compactas */
  .schedule-day-cell,
  .schedule-day {
    min-width: 70px !important;
    max-width: 80px !important;
    padding: 4px !important;
  }
  .schedule-day-cell .day-number,
  .schedule-day .day-number {
    font-size: 16px !important;
  }
  .schedule-day-cell .day-name,
  .schedule-day .day-name {
    font-size: 9px !important;
  }
  
  /* Estadísticas en Publicaciones: 2 columnas */
  .stats-row,
  .publication-stats {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  
  /* Filtros horizontales: stack vertical en lugar de 2 columnas */
  .filters-row,
  .filter-bar {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  .filters-row select,
  .filters-row input,
  .filter-bar select,
  .filter-bar input {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* =====================================================
   FIX UNIVERSAL MÓVIL · scroll tablas + filtros
   ===================================================== */
@media (max-width: 1023px) {
  
  /* TODAS las tablas con scroll horizontal */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    width: 100%;
    max-width: 100%;
  }
  
  /* Si la tabla está dentro de un wrap, que NO escape */
  .card,
  .products-table-card,
  section .card {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    max-width: 100% !important;
  }
  
  /* Filtros: cualquier div con múltiples selects/inputs en fila → stack */
  section > div[style*="display: flex"],
  section > div[style*="display:flex"],
  .filters-row,
  .filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  
  /* Selects/inputs en filtros: full width */
  section select,
  section input[type="text"],
  section input[type="search"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Calendario semanal de Programación */
  .schedule-week,
  .week-table,
  .week-calendar {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: block;
  }
  
  /* Estadísticas Publicaciones: 2 columnas */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  /* Cualquier card de stat más compacta */
  .stat-card,
  .stat-mini {
    padding: 10px 12px !important;
  }
  .stat-value {
    font-size: 22px !important;
  }
  .stat-label {
    font-size: 10px !important;
  }
}

/* =====================================================
   PRODUCTOS · CARDS verticales en móvil
   ===================================================== */
@media (max-width: 1023px) {
  
  /* Ocultar encabezado de tabla en móvil */
  .products-table-header,
  .products-list .table-header,
  thead {
    display: none !important;
  }
  
  /* Cada fila de producto: card vertical */
  .products-table-card .product-row,
  .product-row,
  .product-item,
  .products-list > div {
    display: grid !important;
    grid-template-columns: 60px 1fr !important;
    grid-template-rows: auto auto auto !important;
    gap: 4px 12px !important;
    padding: 12px !important;
    border-bottom: 1px solid #E5E5E7 !important;
    align-items: center !important;
  }
  
  /* La imagen ocupa toda la columna izquierda */
  .product-row > img,
  .product-row .product-thumb,
  .product-row > div:first-child img,
  .product-item img {
    grid-row: 1 / 4 !important;
    grid-column: 1 !important;
    width: 60px !important;
    height: 60px !important;
    object-fit: contain !important;
    border-radius: 6px !important;
  }
  
  /* Resto de info en columna derecha, una debajo de otra */
  .product-row > *:not(:first-child),
  .product-item > *:not(:first-child) {
    grid-column: 2 !important;
    text-align: left !important;
    font-size: 13px !important;
    padding: 0 !important;
  }
  
  /* Etiquetas con labels visibles */
  .product-row .product-name {
    font-weight: 600 !important;
    font-size: 14px !important;
  }
  .product-row .product-brand,
  .product-row .product-category {
    color: #86868B !important;
    font-size: 12px !important;
  }
  .product-row .product-price {
    font-weight: 600 !important;
    color: #1D1D1F !important;
  }
}

/* =====================================================
   FIX TABLET (768px - 1023px)
   ===================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
  
  /* Sidebar compacto pero presente */
  aside.app-sidebar {
    width: 180px !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    transform: none !important;
    box-shadow: none !important;
    border-right: 1px solid #E5E5E7;
  }
  
  /* Main: usar todo el ancho disponible */
  main.app-main {
    margin-left: 180px !important;
    width: calc(100% - 180px) !important;
    max-width: calc(100% - 180px) !important;
    padding: 16px !important;
  }
  
  /* Sidebar nav-items más compactos */
  .nav-item {
    font-size: 13px !important;
    padding: 8px 12px !important;
  }
  
  /* Tabla de productos: usar diseño normal (no cards) pero adaptado */
  .products-table-card {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  
  /* En tablet sí restauramos la tabla normal (no cards de móvil) */
  .product-row,
  .product-item {
    display: flex !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
  }
  
  /* Imagen pequeña */
  .product-row > img,
  .product-row .product-thumb {
    width: 45px !important;
    height: 45px !important;
    flex-shrink: 0 !important;
    grid-row: auto !important;
    grid-column: auto !important;
  }
  
  /* Mostrar encabezado de tabla otra vez */
  .products-table-header,
  thead {
    display: flex !important;
  }
  
  /* Stats grid: 4 columnas en tablet (igual que desktop) */
  .stats-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  
  /* Revisión: 2 columnas */
  .review-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  /* Diseño: 2 columnas */
  .design-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  
  /* Filtros: en fila pero compactos */
  section > div[style*="display: flex"],
  section > div[style*="display:flex"],
  .filters-row,
  .filter-bar {
    flex-direction: row !important;
    gap: 8px !important;
  }
  
  /* Cards genéricas: padding más compacto */
  .card,
  .design-card {
    padding: 16px !important;
  }
}

/* =====================================================
   FORZAR HAMBURGUESA en pantallas < 1024px
   ===================================================== */
@media (max-width: 1023px) {
  .hamburger-btn {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 4px !important;
    width: 36px !important;
    height: 36px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin-right: 12px !important;
  }
  
  .hamburger-btn span {
    display: block !important;
    width: 22px !important;
    height: 2px !important;
    background: #1D1D1F !important;
    border-radius: 2px !important;
    transition: all 0.2s !important;
  }
  
  /* Asegurar sidebar oculto */
  aside.app-sidebar:not(.open) {
    transform: translateX(-100%) !important;
  }
  
  aside.app-sidebar.open {
    transform: translateX(0) !important;
  }
}

/* En DESKTOP (>= 1024px) la hamburguesa NUNCA se muestra */
@media (min-width: 1024px) {
  .hamburger-btn {
    display: none !important;
  }
}

/* =====================================================
   FIX CENTRADO TABLET · contenido full width
   ===================================================== */
@media (max-width: 1023px) {
  
  /* Main: full width sin margen del sidebar */
  main.app-main {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px 24px !important;
  }
  
  /* Quitar cualquier padding/margin del layout que cause el espacio */
  body,
  body > div,
  .app-shell,
  .app-container,
  .app-layout {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }
  
  /* Si hay un grid layout entre sidebar y main */
  body > div[style*="grid"] {
    display: block !important;
    grid-template-columns: 1fr !important;
  }
  
  /* Contenido interno: limitar ancho máximo para legibilidad en tablet */
  main.app-main > section {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
  }
  
}

/* En tablet específicamente, más padding lateral */
@media (min-width: 768px) and (max-width: 1023px) {
  main.app-main {
    padding: 16px 32px !important;
  }
}

/* =====================================================
   VISTA PROMOS DE TIENDA
   ===================================================== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.promos-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.promo-card {
  background: white;
  border: 1px solid #E5E5E7;
  border-radius: 14px;
  padding: 20px;
}

.promo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
}

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

.promo-card-title {
  font-size: 17px;
  font-weight: 600;
  color: #1D1D1F;
  margin-bottom: 4px;
}

.promo-card-meta {
  font-size: 12px;
  color: #86868B;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #F0F7FF;
  color: #26B5DC;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.promo-status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.promo-status-pending {
  background: #FFF8E6;
  color: #B45309;
}
.promo-status-approved {
  background: #ECFDF5;
  color: #047857;
}
.promo-status-rejected {
  background: #FEE2E2;
  color: #B91C1C;
}

.promo-creatives {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.promo-creative-card {
  position: relative;
  background: #FAFAFA;
  border: 1px solid #E5E5E7;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
}

.promo-creative-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.promo-creative-label {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.promo-empty {
  text-align: center;
  padding: 60px 20px;
  color: #86868B;
  background: white;
  border: 1px dashed #E5E5E7;
  border-radius: 14px;
}

.promo-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Mobile/tablet */
@media (max-width: 1023px) {
  .section-header {
    flex-direction: column;
    align-items: stretch;
  }
  .section-header button {
    width: 100%;
  }
  .promo-creatives {
    grid-template-columns: 1fr;
  }
}

/* === REVIEW CARD: PROMO === */
.review-card-promo {
  border-left: 4px solid #26B5DC;
}

.review-card-badge.promo {
  background: #E0F4FB;
  color: #26B5DC;
  border: 1px solid #B8E3F0;
}


/* === BOTONES PUBLICAR PROMO === */
.promo-publish-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #F0F0F0;
  flex-wrap: wrap;
}

.btn-publish-ig,
.btn-publish-fb {
  flex: 1;
  min-width: 110px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  color: white;
  transition: opacity 0.15s;
}
.btn-publish-ig {
  background: linear-gradient(135deg, #833AB4, #FD1D1D, #FCAF45);
}
.btn-publish-fb {
  background: #1877F2;
}
.btn-publish-ig:hover,
.btn-publish-fb:hover {
  opacity: 0.9;
}

@media (max-width: 767px) {
  .promo-publish-actions {
    flex-direction: column;
  }
  .btn-publish-ig,
  .btn-publish-fb {
    width: 100%;
  }
}

/* ── REELS en Revisión ── */
.review-card-reel { border: 2px solid #26B5DC33; }
.review-card-video { background:#0a1628; display:flex; align-items:center; justify-content:center; }
.review-card-video video { width:100%; height:100%; max-height:420px; object-fit:contain; background:#0a1628; }
.review-card-badge.reel { background:#26B5DC; color:#fff; }
.review-actions-reel { display:flex; gap:6px; }
.review-actions-reel button { flex:1; font-size:13px; padding:8px 4px; }
.btn-regen { background:#f0a020; color:#fff; border:none; border-radius:8px; cursor:pointer; }
.btn-regen:hover { background:#d88a10; }

/* Botón Generar Video en lista de productos */
.btn-sm.video { background:#26B5DC; color:#fff; border:none; }
.btn-sm.video:hover { background:#1f9bbd; }

/* Lista de productos en el modal de rechazo de categoría */
.cat-products-mark {
  margin: 8px 0;
}
.cat-products-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0;
  max-height: 280px;
  overflow-y: auto;
}
.cat-product-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid #E5E5E7;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}
.cat-product-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: #F5F5F7;
  border-radius: 4px;
  flex-shrink: 0;
}
.cat-product-item input {
  flex-shrink: 0;
}
