/**
 * marcas.css — Estilos del módulo Marcas (Fase 28).
 * Todo scoped al container .workspace-marcas para no tocar otros estilos.
 */

/* ── Workspace switcher (dropdown arriba del sidebar) — Fase 73 mejorado ── */
.workspace-switcher {
  position: relative;
  margin: 0 14px 14px;
  padding: 12px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 14px;
  cursor: pointer;
  user-select: none;
  transition: all .2s;
  box-shadow: 0 4px 12px rgba(99,102,241,0.28);
}
.workspace-switcher:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(99,102,241,0.38); }
.workspace-switcher-label { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 800; letter-spacing: 0.4px; }
.workspace-switcher-label i.arrow { margin-left: auto; transition: transform .25s; font-size: 11px; opacity: .9; }
.workspace-switcher.open .arrow { transform: rotate(180deg); }

.workspace-switcher-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.16);
  overflow: hidden;
  z-index: 1000;
  display: none;
  padding: 6px;
}
.workspace-switcher.open .workspace-switcher-menu { display: block; }
.workspace-option {
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  color: #0f172a;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  margin-bottom: 4px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.workspace-option:last-child { margin-bottom: 0; }
.workspace-option:hover { background: #f8fafc; }
.workspace-option i { font-size: 16px; color: var(--accent); width: 22px; text-align: center; flex: 0 0 auto; }
.workspace-option > span { flex: 1; min-width: 0; }
.workspace-option.active { background: #eef2ff; color: var(--accent); }
.workspace-option.active::after { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; margin-left: auto; color: var(--accent); font-size: 12px; flex: 0 0 auto; }

/* ── Página principal de marcas ── */
.workspace-marcas { padding: 24px; }
.wm-page-header { margin-bottom: 24px; }
.wm-page-title { font-size: 22px; font-weight: 800; color: #0f172a; display: flex; align-items: center; gap: 10px; }
.wm-page-title i { color: var(--accent); }
.wm-page-subtitle { font-size: 13px; color: #64748b; margin-top: 4px; }

/* ── Card registrar marca ── */
.wm-registrar-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all .2s;
}
.wm-registrar-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(99,102,241,.12); border-color: var(--accent); }
.wm-registrar-card .icon { width: 56px; height: 56px; background: var(--accent); border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; flex-shrink: 0; }
.wm-registrar-card .text { flex: 1; }
.wm-registrar-card .text b { display: block; font-size: 16px; font-weight: 800; color: #0f172a; }
.wm-registrar-card .text span { font-size: 13px; color: #64748b; }

/* ── Stats + filtros ── */
.wm-stats-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.wm-stats-row input.wm-search { flex: 1; min-width: 260px; padding: 12px 16px; border: 1px solid #e2e8f0; border-radius: 99px; font-size: 13px; background: #fff; font-family: inherit; }
.wm-stats-row input.wm-search:focus { outline: none; border-color: var(--accent); }
.wm-stat-chip { padding: 10px 18px; background: #fff; border: 1px solid #e2e8f0; border-radius: 99px; font-size: 13px; display: flex; align-items: center; gap: 8px; font-weight: 600; color: #0f172a; }
.wm-stat-chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.wm-stat-chip .dot.ok { background: #22c55e; }
.wm-stat-chip .dot.inc { background: #f59e0b; }

/* ── Grid de marcas (Fase 28.8 — rediseño logo grande + iconos glass) ── */
.wm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.wm-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  overflow: hidden;
  transition: all .25s ease;
  position: relative;
  cursor: pointer;
  aspect-ratio: 4/5;
}
.wm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(99,102,241,.15);
  border-color: transparent;
}
.wm-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--accent);
  z-index: 3;
}

/* Logo MUY prominente — 75% del area */
.wm-card-logo-area {
  position: relative;
  height: 75%;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}
.wm-card-logo-area img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,.12));
  transition: transform .3s ease;
}
.wm-card:hover .wm-card-logo-area img { transform: scale(1.06); }
.wm-card-logo-placeholder {
  width: 75%;
  aspect-ratio: 1;
  max-width: 180px;
  border-radius: 32px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 900;
  letter-spacing: 2px;
  box-shadow: 0 14px 40px rgba(99,102,241,.3);
}

/* Info footer — solo nombre grande y centrado */
.wm-card-body {
  height: 25%;
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #fff;
  text-align: center;
}
.wm-card h3 {
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
  line-height: 1.15;
  letter-spacing: -0.3px;
}
.wm-card .meta {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}
.wm-card .meta i { margin-right: 4px; color: var(--accent); }
@media (min-width: 1200px) {
  .wm-card h3 { font-size: 22px; }
}
.wm-card .status {
  position: absolute;
  top: 14px; right: 14px;
  font-size: 9px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 99px;
  letter-spacing: .5px;
  text-transform: none;
  z-index: 3;
}
.wm-card .status.ok { background: #d1fae5; color: #065f46; }
.wm-card .status.inc { background: #fef3c7; color: #92400e; }

/* Overlay de iconos glass — aparece en hover */
.wm-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  background: rgba(99,102,241,.25);
  backdrop-filter: blur(4px);
}
.wm-card:hover .wm-card-overlay {
  opacity: 1;
  pointer-events: auto;
}
.wm-card-icon-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(16px);
  color: #0f172a;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
  transition: all .2s ease;
  transform: scale(.8);
}
.wm-card:hover .wm-card-icon-btn {
  transform: scale(1);
}
.wm-card-icon-btn:hover {
  transform: scale(1.15) !important;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.wm-card-icon-btn.primary {
  background: #10b981;
  color: #fff;
  width: 66px;
  height: 66px;
  font-size: 22px;
}
.wm-card-icon-btn.danger {
  background: rgba(239,68,68,.95);
  color: #fff;
}

/* ── Ficha de trabajo de UNA marca ── */
.wm-ficha-header { background: #fff; border-radius: 16px; padding: 20px 24px; margin-bottom: 18px; display: flex; align-items: center; gap: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.wm-ficha-header .back-btn { background: #f1f5f9; border: none; padding: 8px 14px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; gap: 6px; color: #334155; font-weight: 600; font-size: 12px; }
.wm-ficha-header .back-btn:hover { background: #e2e8f0; }
.wm-ficha-header .title { font-size: 20px; font-weight: 800; color: #0f172a; flex: 1; }

.wm-modos-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.wm-modo-card { background: #fff; border: 2px solid #e2e8f0; border-radius: 14px; padding: 18px 16px; cursor: pointer; text-align: center; transition: all .2s; }
.wm-modo-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 24px rgba(99,102,241,.15); }
.wm-modo-card .icon { font-size: 28px; color: var(--accent); margin-bottom: 8px; }
.wm-modo-card b { display: block; font-size: 13px; color: #0f172a; margin-bottom: 4px; }
.wm-modo-card span { font-size: 11px; color: #64748b; line-height: 1.4; display: block; }

.wm-posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }

/* ── Fase 28.3: Cards pro estilo INTECAP con imagen de fondo ── */
.wm-post-card-pro {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 14px;
  overflow: hidden;
  background: #f8fafc;
  cursor: pointer;
  transition: all .25s ease;
  min-height: 320px;
}
.wm-post-card-pro:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,.14); }
.wm-post-card-pro .post-bg {
  position: absolute; inset: 0;
  background-color: #0f172a;
}
.wm-post-card-pro .post-bg-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #0f172a;
  z-index: 1;
}
.wm-post-card-pro .post-bg-video-fallback {
  position: absolute; inset: 0;
  background: #1e293b;
  z-index: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #94a3b8;
}
.wm-post-card-pro .post-bg-video-fallback i { font-size: 56px; opacity: .4; }
.wm-post-card-pro .post-bg-video-fallback small { font-size: 11px; opacity: .6; padding: 0 16px; text-align: center; word-break: break-all; }
.wm-post-card-pro .post-video-overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(0,0,0,.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  z-index: 2;
  backdrop-filter: blur(6px);
  pointer-events: none;
  opacity: .85;
}
.wm-post-card-pro.has-bg .post-bg-video + .post-glass::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(0,0,0,.85);
  pointer-events: none;
  z-index: 1;
}
.wm-post-card-pro.has-bg .post-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(0,0,0,.85);
}
.wm-post-card-pro .post-glass {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  color: #fff;
}
.wm-post-card-pro:not(.has-bg) .post-glass { color: #0f172a; }
.wm-post-card-pro .post-top {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.wm-post-card-pro .post-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 99px;
  text-transform: none;
  letter-spacing: .5px;
  backdrop-filter: blur(10px);
}
.wm-post-card-pro.has-bg .post-badge { background: rgba(255,255,255,.95) !important; }
.wm-post-card-pro .post-badge-chip {
  background: rgba(15,23,42,.75);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 99px;
  backdrop-filter: blur(6px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.wm-post-card-pro .post-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 4px;
  text-shadow: 0 2px 4px rgba(0,0,0,.3);
  word-wrap: break-word;
}
.wm-post-card-pro:not(.has-bg) .post-title { text-shadow: none; }
.wm-post-card-pro .post-meta {
  font-size: 11px;
  opacity: .85;
  margin-bottom: 8px;
}
.wm-post-card-pro .post-actions {
  display: flex;
  gap: 6px;
}
.wm-post-card-pro .post-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: transform .15s;
}
.wm-post-card-pro .post-btn:hover { transform: scale(1.03); }
.wm-post-card-pro .post-btn-primary {
  background: rgba(255,255,255,.95);
  color: #0f172a;
}
.wm-post-card-pro .post-btn-icon {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(255,255,255,.85);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s;
}
.wm-post-card-pro .post-btn-icon:hover { transform: scale(1.1); }
.wm-post-card-pro .post-btn-icon.danger { background: rgba(239,68,68,.9); color: #fff; }

/* ── Fase 28.9: Calendario de publicaciones ── */
.wm-cal-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 16px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  flex-wrap: wrap;
}
.wm-cal-label {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  text-transform: capitalize;
  min-width: 180px;
  text-align: center;
}
.wm-cal-view-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
}
.wm-cal-view-btn {
  padding: 8px 14px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}
.wm-cal-view-btn:hover:not(.active) { color: #334155; background: rgba(255,255,255,.6); }
.wm-cal-view-btn.active {
  background: #fff;
  color: var(--accent, #6366f1);
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.wm-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  background: #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.wm-cal-weekday {
  background: #f8fafc;
  padding: 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
  color: #64748b;
  letter-spacing: .5px;
}
.wm-cal-day {
  background: #fff;
  min-height: 110px;
  padding: 6px 8px;
  cursor: pointer;
  transition: background .15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.wm-cal-day:hover { background: #f8fafc; }
.wm-cal-day.fuera-mes { background: #fafbfc; opacity: .4; }
.wm-cal-day.hoy {
  background: #eef2ff;
  box-shadow: inset 0 0 0 2px var(--accent, #6366f1);
}
.wm-cal-day-num {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}
.wm-cal-day.hoy .wm-cal-day-num { color: var(--accent, #6366f1); }
.wm-cal-post-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(99,102,241,.12);
  color: #4338ca;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: all .15s;
}
.wm-cal-post-chip:hover { background: rgba(99,102,241,.22); transform: translateX(2px); }
.wm-cal-post-chip .logo-mini {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 8px;
  font-weight: 800;
}
.wm-cal-post-chip .logo-mini img { width: 100%; height: 100%; object-fit: cover; }
.wm-cal-post-chip span { overflow: hidden; text-overflow: ellipsis; }
.wm-cal-day-mas {
  font-size: 10px;
  color: #64748b;
  padding: 2px 6px;
  font-weight: 700;
}
.wm-cal-day-crear {
  position: absolute;
  bottom: 6px; right: 6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(99,102,241,.15);
  color: #6366f1;
  cursor: pointer;
  font-size: 10px;
  opacity: 0;
  transition: opacity .15s;
}
.wm-cal-day:hover .wm-cal-day-crear { opacity: 1; }
.wm-cal-day-crear:hover { background: var(--accent); color: #fff; transform: scale(1.1); }

/* Vista año: grid 4x3 con mini-calendarios */
.wm-cal-anio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.wm-cal-anio-mes {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all .2s;
}
.wm-cal-anio-mes:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(99,102,241,.1); border-color: #c7d2fe; }
.wm-cal-anio-mes-titulo {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  text-transform: capitalize;
  margin-bottom: 8px;
}
.wm-cal-anio-mini {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  font-size: 10px;
}
.wm-cal-anio-mini-dia {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #64748b;
}
.wm-cal-anio-mini-dia.con-posts {
  background: rgba(99,102,241,.15);
  color: #4338ca;
  font-weight: 800;
}
.wm-cal-anio-mini-dia.hoy {
  background: var(--accent, #6366f1);
  color: #fff;
  font-weight: 800;
}

/* Resumen mes */
.wm-cal-resumen-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e0e7ff;
}
.wm-cal-resumen-item .logo-mini {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
}
.wm-cal-resumen-item .logo-mini img { width: 100%; height: 100%; object-fit: cover; }
.wm-cal-resumen-item-nombre { font-size: 13px; font-weight: 700; color: #0f172a; }
.wm-cal-resumen-item-num { font-size: 11px; color: #6366f1; font-weight: 800; }

/* ── Fase 28.7: Botones grandes de marca con logo ── */
.wm-marcas-chips-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.wm-marca-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 99px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  transition: all .2s;
  min-height: 52px;
}
.wm-marca-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99,102,241,.12);
  border-color: #cbd5e1;
}
.wm-marca-chip.active {
  background: var(--accent, #6366f1);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(99,102,241,.3);
}
.wm-marca-chip .logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
  color: #64748b;
}
.wm-marca-chip.active .logo { background: rgba(255,255,255,.2); color: #fff; }
.wm-marca-chip .logo img { width: 100%; height: 100%; object-fit: cover; }
.wm-marca-chip .count {
  background: rgba(0,0,0,.08);
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
}
.wm-marca-chip.active .count { background: rgba(255,255,255,.25); }
.wm-marca-chip.todas {
  padding: 10px 18px;
}
.wm-marca-chip.todas .logo {
  background: #f1f5f9;
}
.wm-marca-chip.todas.active .logo {
  background: rgba(255,255,255,.25);
}

/* ── Chips de filtro estilo INTECAP ── */
.wm-chips-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
}
.wm-chip {
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  color: #334155;
  font-family: inherit;
}
.wm-chip:hover { border-color: #cbd5e1; }
.wm-chip.active { background: var(--accent, #6366f1); color: #fff; border-color: var(--accent, #6366f1); }
.wm-chip .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.wm-post-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; transition: all .2s; }
.wm-post-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.wm-post-card .img { aspect-ratio: 1/1; background: #f1f5f9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.wm-post-card .img img { width: 100%; height: 100%; object-fit: cover; }
.wm-post-card .body { padding: 12px 14px; }
.wm-post-card h4 { font-size: 13px; font-weight: 700; color: #0f172a; line-height: 1.3; margin-bottom: 4px; }
.wm-post-card .meta { font-size: 11px; color: #64748b; margin-bottom: 10px; }
.wm-post-card .estado-badge { font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 99px; text-transform: none; letter-spacing: 0; }
.wm-post-card .estado-borrador { background: #f1f5f9; color: #64748b; }
.wm-post-card .estado-revision { background: #fef3c7; color: #92400e; }
.wm-post-card .estado-aprobado { background: #d1fae5; color: #065f46; }
.wm-post-card .actions { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid #f1f5f9; background: #fafbfc; }
.wm-post-card .actions button { flex: 1; padding: 8px 10px; border: none; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 4px; }

/* ── Modal genérico (overlay del módulo marcas) ── */
.wm-modal { position: fixed; inset: 0; background: rgba(15,23,42,.6); backdrop-filter: blur(6px); z-index: 9999; display: none; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; }
.wm-modal.show { display: flex; }
.wm-modal-content { background: #fff; border-radius: 20px; width: 100%; max-width: 680px; overflow: hidden; box-shadow: 0 25px 80px rgba(0,0,0,.3); }
.wm-modal-header { padding: 20px 24px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wm-modal-header .t { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.wm-modal-header .x { background: rgba(255,255,255,.2); border: none; color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 16px; }
.wm-modal-body { padding: 24px; }
.wm-field { margin-bottom: 16px; }
.wm-field label { display: block; font-size: 12px; font-weight: 700; color: #334155; margin-bottom: 6px; text-transform: none; letter-spacing: 0; }
.wm-field input, .wm-field textarea, .wm-field select { width: 100%; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 14px; font-family: inherit; background: #fff; color: #0f172a; }
.wm-field input:focus, .wm-field textarea:focus, .wm-field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.wm-field textarea { min-height: 100px; resize: vertical; }
.wm-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wm-modal-actions { padding: 16px 24px; background: #fafbfc; border-top: 1px solid #e2e8f0; display: flex; gap: 10px; justify-content: flex-end; }
.wm-btn { padding: 10px 20px; border: none; border-radius: 10px; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.wm-btn-primary { background: var(--accent); color: #fff; }
.wm-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(99,102,241,.3); }
.wm-btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.wm-btn-ghost { background: #f1f5f9; color: #334155; }
.wm-btn-ghost:hover { background: #e2e8f0; }
.wm-btn-success { background: #10b981; color: #fff; }
.wm-btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16,185,129,.3); }

/* ── Redes checkboxes ── */
.wm-redes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wm-red-check { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1.5px solid #e2e8f0; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; }
.wm-red-check input { width: 16px; height: 16px; }
.wm-red-check.checked { border-color: var(--accent); background: #eef2ff; color: var(--accent); }

/* ── Zona de subida de imágenes ── */
.wm-upload-zone { border: 2px solid #cbd5e1; border-radius: 14px; padding: 30px 20px; text-align: center; cursor: pointer; transition: all .2s; background: #fafbfc; }
.wm-upload-zone:hover { border-color: var(--accent); background: #eef2ff; }
.wm-upload-zone i { font-size: 30px; color: var(--accent); margin-bottom: 8px; }
.wm-upload-zone b { display: block; font-size: 13px; color: #0f172a; margin-bottom: 4px; }
.wm-upload-zone span { font-size: 11px; color: #64748b; }
.wm-upload-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 12px; }
.wm-upload-preview .preview { aspect-ratio: 1/1; border-radius: 8px; overflow: hidden; position: relative; background: #f1f5f9; border: 1px solid #e2e8f0; }
.wm-upload-preview .preview img, .wm-upload-preview .preview video { width: 100%; height: 100%; object-fit: cover; }
.wm-upload-preview .del { position: absolute; top: 4px; right: 4px; background: rgba(239,68,68,.95); color: #fff; border: none; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 11px; }

/* ── Empty states ── */
.wm-empty { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 40px; text-align: center; color: #64748b; }
.wm-empty i { font-size: 40px; color: #cbd5e1; margin-bottom: 12px; display: block; }
.wm-empty b { display: block; font-size: 16px; color: #0f172a; margin-bottom: 6px; }

/* ── Fase 28.3: Tabs del modal ficha post ── */
.wm-ficha-tab {
  padding: 14px 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  border-bottom: 3px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .15s;
}
.wm-ficha-tab:hover { color: #334155; background: #eef2ff; }
.wm-ficha-tab.active { color: #6366f1; border-bottom-color: #6366f1; }
.wm-ficha-count {
  background: #6366f1;
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 800;
}

/* ── Slider de archivos ── */
.wm-slider-wrap {
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.wm-slider-track {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.wm-slider-track img, .wm-slider-track video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: none;
}
.wm-slider-track .active { display: block; }
.wm-slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: #0f172a;
  z-index: 3;
  transition: all .15s;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.wm-slider-nav:hover { transform: translateY(-50%) scale(1.1); }
.wm-slider-nav.prev { left: 16px; }
.wm-slider-nav.next { right: 16px; }
.wm-slider-nav:disabled { opacity: .3; cursor: not-allowed; }
.wm-slider-indicator {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.7);
  color: #fff;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

/* ── Miniaturas de archivos ── */
.wm-mini {
  aspect-ratio: 1/1;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #f1f5f9;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .15s;
}
.wm-mini.active { border-color: #6366f1; transform: scale(1.03); }
.wm-mini img, .wm-mini video { width: 100%; height: 100%; object-fit: cover; }
.wm-mini-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(239,68,68,.9);
  color: #fff;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  opacity: 0;
  transition: opacity .15s;
}
.wm-mini:hover .wm-mini-delete { opacity: 1; }
/* Fase 65 — botón Reemplazar archivo en miniatura (al lado del eliminar) */
.wm-mini-replace {
  position: absolute;
  top: 4px;
  right: 30px;
  background: rgba(59,130,246,.9);
  color: #fff;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  opacity: 0;
  transition: opacity .15s;
}
.wm-mini:hover .wm-mini-replace { opacity: 1; }
.wm-mini-type {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 99px;
  text-transform: none;
  font-weight: 700;
}

/* ── Historial timeline ── */
.wm-historial-item {
  background: #f8fafc;
  border-left: 3px solid #6366f1;
  padding: 10px 14px;
  border-radius: 6px;
}
.wm-historial-item .hist-fecha { font-size: 11px; color: #64748b; }
.wm-historial-item .hist-evento { font-size: 13px; font-weight: 700; color: #0f172a; margin-top: 2px; }
.wm-historial-item .hist-detalle { font-size: 12px; color: #334155; margin-top: 4px; }

/* ── Barra de iconos emoji para insertar en texto (Fase 28.2) ── */
.wm-iconos-bar .wm-icon-btn {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  padding: 0;
}
.wm-iconos-bar .wm-icon-btn:hover {
  background: #eef2ff;
  border-color: #6366f1;
  transform: scale(1.1);
}

/* ── Tabs de modos de post ── */
.wm-tab-row { display: flex; background: #f1f5f9; border-radius: 12px; padding: 4px; margin-bottom: 16px; gap: 4px; }
.wm-tab { flex: 1; padding: 10px 14px; border: none; background: transparent; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 700; color: #64748b; }
.wm-tab:hover { background: rgba(255,255,255,.5); color: #334155; }
.wm-tab.active { background: #fff; color: var(--accent); box-shadow: 0 2px 6px rgba(0,0,0,.08); }

@media (max-width: 768px) {
  .wm-modos-row { grid-template-columns: 1fr; }
  .wm-field-row { grid-template-columns: 1fr; }
  .wm-redes-grid { grid-template-columns: repeat(2, 1fr); }
  .wm-grid { grid-template-columns: 1fr; }
}


/* ═══ FASE 28.12 — LIBRERÍA ═══ */
.workspace-marcas .wm-lib-tabs{display:flex;gap:8px;flex-wrap:wrap;border-bottom:2px solid #e2e8f0;padding-bottom:0;margin-top:18px;}
.workspace-marcas .wm-lib-tab{background:none;border:none;padding:10px 16px;font-size:13px;font-weight:600;color:#64748b;cursor:pointer;border-bottom:3px solid transparent;margin-bottom:-2px;display:inline-flex;align-items:center;gap:8px;transition:.15s;}
.workspace-marcas .wm-lib-tab:hover{color:#334155;}
.workspace-marcas .wm-lib-tab.active{color:#6366f1;border-bottom-color:#6366f1;}
.workspace-marcas .wm-lib-tab .count{background:#eef2ff;color:#6366f1;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:700;}

.workspace-marcas .wm-lib-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:10px 14px;margin-top:12px;margin-bottom:14px;}
.workspace-marcas .wm-lib-checkall{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:#475569;cursor:pointer;}
.workspace-marcas .wm-lib-checkall input{width:18px;height:18px;cursor:pointer;}

.workspace-marcas .wm-lib-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px;}
.workspace-marcas .wm-lib-card{position:relative;background:#fff;border:1.5px solid #e2e8f0;border-radius:12px;overflow:hidden;cursor:pointer;transition:.15s;display:flex;flex-direction:column;}
.workspace-marcas .wm-lib-card:hover{border-color:#6366f1;box-shadow:0 4px 12px rgba(99,102,241,.12);}
.workspace-marcas .wm-lib-card.selected{border-color:#6366f1;box-shadow:0 0 0 3px rgba(99,102,241,.2);}
.workspace-marcas .wm-lib-card.en-uso{border-color:#fecaca;}
.workspace-marcas .wm-lib-card.en-uso.selected{border-color:#dc2626;}

.workspace-marcas .wm-lib-thumb{width:100%;aspect-ratio:1;background:#f1f5f9;display:flex;align-items:center;justify-content:center;overflow:hidden;position:relative;}
.workspace-marcas .wm-lib-thumb img{width:100%;height:100%;object-fit:cover;}
.workspace-marcas .wm-lib-thumb video{width:100%;height:100%;object-fit:cover;background:#000;}
.workspace-marcas .wm-lib-thumb .icon-placeholder{font-size:38px;color:#cbd5e1;}
.workspace-marcas .wm-lib-card-check{position:absolute;top:8px;left:8px;width:22px;height:22px;cursor:pointer;z-index:2;}

.workspace-marcas .wm-lib-badge{position:absolute;top:8px;right:8px;padding:3px 8px;border-radius:6px;font-size:10px;font-weight:700;text-transform: none;letter-spacing: 0;z-index:2;display:inline-flex;align-items:center;gap:4px;}
.workspace-marcas .wm-lib-badge.activo{background:#fee2e2;color:#dc2626;}
.workspace-marcas .wm-lib-badge.archivado{background:#ddd6fe;color:#6d28d9;}
.workspace-marcas .wm-lib-badge.libre{background:#dcfce7;color:#16a34a;}

.workspace-marcas .wm-lib-body{padding:8px 10px;font-size:11px;color:#475569;background:#fff;}
.workspace-marcas .wm-lib-body .name{font-weight:600;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:2px;}
.workspace-marcas .wm-lib-body .meta{font-size:10px;color:#94a3b8;display:flex;justify-content:space-between;}


/* ═══════════════════════════════════════════════════════════
   FASE 28.15 — Workspace switcher mejorado + Mobile bottom nav
   ═══════════════════════════════════════════════════════════ */

/* Switcher más pulido con ícono separado */
.workspace-switcher {
  margin: 14px 14px 16px;
  padding: 12px 14px;
  background: #6366f1;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(99,102,241,0.28), inset 0 1px 0 rgba(255,255,255,0.2);
  position: relative;
  overflow: visible;
}
.workspace-switcher::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 40%);
  pointer-events: none;
}
.workspace-switcher-label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.workspace-switcher-label i:not(.arrow) {
  background: rgba(255,255,255,0.22);
  width: 28px; height: 28px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  backdrop-filter: blur(8px);
}
.workspace-switcher-menu {
  border: 1px solid #e2e8f0;
  padding: 4px;
}
.workspace-option {
  border-radius: 10px;
  border-bottom: none;
  margin-bottom: 2px;
}
.workspace-option:last-child { margin-bottom: 0; }
.workspace-option:hover { background: #f8fafc; }

/* ── MOBILE: bottom nav estilo app (solo workspace marcas) ── */
@media (max-width: 900px) {
  /* Ocultar sidebar completa en móvil cuando marcas está activo */
  body.ws-marcas-active .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .25s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }
  /* Fase 49: aceptar tanto .mobile-open (legacy) como .open (handler global)
     — antes el hamburger en marcas mostraba el overlay sin abrir el sidebar
     porque scripts-init.php toggleaba .open y aquí solo se escuchaba .mobile-open. */
  body.ws-marcas-active .sidebar.mobile-open,
  body.ws-marcas-active .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0,0,0,0.3);
  }

  /* Fase 49: bottom-nav Marcas — labels cortos en móvil para que no se solapen.
     En desktop se ve el texto largo; en mobile (< 900px) se cambia al span corto. */
  body.ws-marcas-active #sidebar-nav-marcas:not(.hidden) .nav-lbl-d { display: none !important; }
  body.ws-marcas-active #sidebar-nav-marcas:not(.hidden) .nav-lbl-m { display: inline !important; }

  /* Fase 49 — Cuando el sidebar se abre, traer marcas-nav DENTRO del sidebar como
     nav vertical con labels largos. Reemplaza la bottom-nav (es el mismo elemento)
     mientras el menú está abierto. Al cerrar, la bottom-nav vuelve sola. */
  body.ws-marcas-active .sidebar.open #sidebar-nav-marcas:not(.hidden),
  body.ws-marcas-active .sidebar.mobile-open #sidebar-nav-marcas:not(.hidden) {
    position: static !important;
    flex-direction: column !important;
    background: transparent !important;
    border-top: none !important;
    box-shadow: none !important;
    padding: 6px 8px !important;
    height: auto !important;
    min-height: auto !important;
    gap: 2px !important;
    z-index: auto !important;
  }
  body.ws-marcas-active .sidebar.open #sidebar-nav-marcas:not(.hidden) .nav-item,
  body.ws-marcas-active .sidebar.mobile-open #sidebar-nav-marcas:not(.hidden) .nav-item {
    flex: none !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    text-align: left !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    gap: 12px !important;
    color: #475569 !important;
    background: transparent !important;
    border-radius: 10px !important;
    white-space: normal !important;
    overflow: visible !important;
    line-height: 1.3 !important;
  }
  body.ws-marcas-active .sidebar.open #sidebar-nav-marcas:not(.hidden) .nav-item i,
  body.ws-marcas-active .sidebar.mobile-open #sidebar-nav-marcas:not(.hidden) .nav-item i {
    font-size: 16px !important;
    width: 22px;
    text-align: center;
  }
  body.ws-marcas-active .sidebar.open #sidebar-nav-marcas:not(.hidden) .nav-item.active,
  body.ws-marcas-active .sidebar.mobile-open #sidebar-nav-marcas:not(.hidden) .nav-item.active {
    background: #eef2ff !important;
    color: #6366f1 !important;
  }
  body.ws-marcas-active .sidebar.open #sidebar-nav-marcas:not(.hidden) .nav-lbl-d,
  body.ws-marcas-active .sidebar.mobile-open #sidebar-nav-marcas:not(.hidden) .nav-lbl-d { display: inline !important; }
  body.ws-marcas-active .sidebar.open #sidebar-nav-marcas:not(.hidden) .nav-lbl-m,
  body.ws-marcas-active .sidebar.mobile-open #sidebar-nav-marcas:not(.hidden) .nav-lbl-m { display: none !important; }
  body.ws-marcas-active .main-content {
    margin-left: 0 !important;
    padding-bottom: 78px !important; /* espacio para bottom nav */
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* El nav-marcas se reubica al bottom de la pantalla */
  body.ws-marcas-active #sidebar-nav-marcas:not(.hidden) {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -6px 24px rgba(15,23,42,0.08);
    display: flex !important;
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
    padding: 6px 2px calc(6px + env(safe-area-inset-bottom, 0));
    gap: 2px;
    margin: 0;
    z-index: 150;
    height: auto;
    min-height: 66px;
  }
  body.ws-marcas-active #sidebar-nav-marcas:not(.hidden) .nav-item {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column !important;
    gap: 3px !important;
    padding: 8px 2px !important;
    font-size: 10px !important;
    font-weight: 600;
    background: transparent !important;
    color: #64748b !important;
    border: none !important;
    border-radius: 10px !important;
    text-align: center;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: none !important;
  }
  body.ws-marcas-active #sidebar-nav-marcas:not(.hidden) .nav-item i {
    font-size: 20px !important;
    margin: 0 !important;
    color: #64748b;
  }
  body.ws-marcas-active #sidebar-nav-marcas:not(.hidden) .nav-item.active {
    background: #eef2ff !important;
    color: #6366f1 !important;
  }
  body.ws-marcas-active #sidebar-nav-marcas:not(.hidden) .nav-item.active i {
    color: #6366f1 !important;
  }

  /* Header fijo arriba con gradiente + título + botón hamburguesa */
  body.ws-marcas-active::before {
    content: '🎨  MARCAS';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 54px;
    background: #6366f1;
    box-shadow: 0 2px 10px rgba(99,102,241,0.25);
    z-index: 130;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.6px;
    font-size: 15px;
  }
  body.ws-marcas-active .main-content {
    padding-top: 66px !important;
  }
  body.ws-marcas-active .mobile-toggle {
    display: block !important;
    position: fixed;
    top: 8px; left: 10px;
    width: 38px; height: 38px;
    background: rgba(255,255,255,0.22) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    border-radius: 10px !important;
    z-index: 145;
    backdrop-filter: blur(8px);
  }

  /* Ajustes del contenido de marcas en móvil */
  /* Fase 67: gap aumentado de 10 → 14px y mínimo 140 → 160px para que las
     cards no se peguen entre sí y se respiren mejor en pantallas chicas. */
  body.ws-marcas-active .workspace-marcas { padding: 16px 12px !important; }
  body.ws-marcas-active .workspace-marcas .wm-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }
  body.ws-marcas-active .workspace-marcas .wm-page-title {
    font-size: 18px;
  }
  body.ws-marcas-active .workspace-marcas .wm-stats-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  body.ws-marcas-active .workspace-marcas .wm-search {
    flex: 1 1 100%;
    min-width: 0;
  }
  body.ws-marcas-active .workspace-marcas .wm-modos-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  /* Fase 67: posts-grid también respira más */
  body.ws-marcas-active .workspace-marcas .wm-posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }
  body.ws-marcas-active .workspace-marcas .wm-modal-content {
    max-width: 96vw !important;
    max-height: 92vh;
    margin: 4vh 2vw;
  }
  body.ws-marcas-active .workspace-marcas .wm-field-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Calendario móvil: cards más pequeñas */
  body.ws-marcas-active .wm-cal-grid {
    gap: 2px;
  }
  body.ws-marcas-active .wm-cal-day {
    min-height: 62px;
    padding: 4px 3px;
    font-size: 10px;
  }
  body.ws-marcas-active .wm-cal-day-num { font-size: 11px; }
  body.ws-marcas-active .wm-cal-post-chip {
    font-size: 9px;
    padding: 1px 3px;
  }
  body.ws-marcas-active .wm-cal-post-chip span { display: none; }
  body.ws-marcas-active .wm-cal-anio-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Librería: grid más compacto */
  body.ws-marcas-active .wm-lib-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }

  /* Botón hamburguesa del sidebar (abre sidebar completo si el usuario lo quiere) */
  body.ws-marcas-active .mobile-toggle {
    display: block !important;
    z-index: 145;
  }
}

/* Tablet / desktop: asegurar que workspace switcher se vea bien */
@media (min-width: 901px) {
  body.ws-marcas-active .sidebar { transform: none; }
}

/* Fase 67: pantallas muy chicas (<420px, ej iPhone SE/mini) — una sola columna
   grande para que las cards de marca y posts se vean bien sin compactarse.
   Override final, después del @media (max-width: 768px) anterior. */
@media (max-width: 420px) {
  body.ws-marcas-active .workspace-marcas .wm-grid,
  body.ws-marcas-active .workspace-marcas .wm-posts-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  body.ws-marcas-active .workspace-marcas { padding: 14px 10px !important; }
}

/* Fase 49: por defecto (desktop y >900px) el span corto está oculto y el largo visible.
   Las reglas dentro de @media (max-width: 900px) lo invierten para mobile bottom-nav. */
.nav-lbl-m { display: none; }
.nav-lbl-d { display: inline; }


/* ═══════════════════════════════════════════════════════════
   FASE 96 — Mobile Funcional Completo (tabs/chips scroll horizontal)
   ═══════════════════════════════════════════════════════════
   Resuelve: en mobile las tabs (modos de post, librería, calendario) y los
   chips de marcas se envuelven en múltiples filas o se aprietan, dejando
   opciones cortadas o difíciles de tocar. Solución: scroll horizontal con
   scroll-snap (estilo iOS/Android), scrollbar oculto, touch targets ≥44px.
   Patrón unificado aplicado a TODOS los containers que pueden overflow.
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Contenedor de tabs/chips con scroll horizontal */
  .workspace-marcas .wm-tab-row,
  .workspace-marcas .wm-lib-tabs,
  .workspace-marcas .wm-cal-view-tabs,
  .workspace-marcas .wm-marcas-chips-row {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;             /* Firefox */
    -ms-overflow-style: none;          /* IE/Edge legacy */
    padding-bottom: 4px;
    /* Indicador visual sutil de que se puede scrollear */
    background-clip: padding-box;
  }
  .workspace-marcas .wm-tab-row::-webkit-scrollbar,
  .workspace-marcas .wm-lib-tabs::-webkit-scrollbar,
  .workspace-marcas .wm-cal-view-tabs::-webkit-scrollbar,
  .workspace-marcas .wm-marcas-chips-row::-webkit-scrollbar {
    display: none;
  }

  /* Cada tab/chip: ancho según contenido + touch target ≥44px + snap-align */
  .workspace-marcas .wm-tab-row .wm-tab,
  .workspace-marcas .wm-lib-tabs .wm-lib-tab,
  .workspace-marcas .wm-cal-view-tabs .wm-cal-view-btn,
  .workspace-marcas .wm-marcas-chips-row .wm-marca-chip {
    flex: 0 0 auto !important;
    scroll-snap-align: start;
    min-width: max-content;
    min-height: 44px;
    white-space: nowrap;
  }

  /* Tabs de modos de post: padding más cómodo en mobile (eran 10px 14px → 12px 18px) */
  .workspace-marcas .wm-tab-row .wm-tab {
    padding: 12px 18px;
    font-size: 13px;
  }

  /* Tabs de librería: idem */
  .workspace-marcas .wm-lib-tabs .wm-lib-tab {
    padding: 12px 16px;
    font-size: 13px;
  }

  /* Tabs Mes/Semana/Año: con borde redondeado y altura cómoda */
  .workspace-marcas .wm-cal-view-tabs .wm-cal-view-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  /* Chips de marcas: mantienen su altura 52px ya definida pero se aseguran touch */
  .workspace-marcas .wm-marcas-chips-row .wm-marca-chip {
    min-height: 48px;
  }

  /* Search input ocupando todo el ancho disponible */
  .workspace-marcas .wm-stats-row .wm-search {
    width: 100%;
    min-height: 44px;
    font-size: 14px;
  }

  /* Page header: tipografía un punto menor para que no overflow */
  .workspace-marcas .wm-page-title { font-size: 18px; }
  .workspace-marcas .wm-page-subtitle { font-size: 12px; }

  /* Botones genéricos: touch target garantizado en mobile */
  .workspace-marcas .wm-btn {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 13px;
  }

  /* Modal: el body con scroll interno (max-height ya lo cubre el override 96vw/92vh
     en línea 1269, aquí solo aseguramos overflow:auto en wm-modal-body) */
  .workspace-marcas .wm-modal-body {
    max-height: calc(92vh - 130px); /* 92vh modal − header (~70px) − footer actions (~60px) */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px;
  }
  .workspace-marcas .wm-modal-actions {
    padding: 12px 18px;
    flex-wrap: wrap;
  }
  .workspace-marcas .wm-modal-actions .wm-btn {
    flex: 1 1 auto;
    min-width: 100px;
  }
  .workspace-marcas .wm-modal-header {
    padding: 14px 18px;
  }
  .workspace-marcas .wm-modal-header .t {
    font-size: 14px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .workspace-marcas .wm-modal-header .x {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
  }
}

/* Más pequeño aún: mobile chico (iPhone SE etc.) */
@media (max-width: 380px) {
  .workspace-marcas .wm-tab-row .wm-tab {
    padding: 12px 14px;
    font-size: 12px;
  }
  .workspace-marcas .wm-tab-row .wm-tab i {
    margin-right: 4px;
  }
  .workspace-marcas .wm-marcas-chips-row .wm-marca-chip {
    padding: 8px 12px 8px 10px;
    font-size: 12px;
  }
}


/* ═══ Fase 28.16b — Fix dropdown workspace en móvil ═══ */
@media (max-width: 900px) {
  /* En móvil el dropdown empuja el contenido hacia abajo (no se superpone) */
  .workspace-switcher-menu {
    position: static !important;
    margin-top: 6px !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
  }
  .workspace-switcher.open .workspace-switcher-menu {
    display: block !important;
  }
  .workspace-option {
    padding: 14px 14px !important;
    font-size: 14px !important;
  }
  /* Sidebar con scroll suave y footer siempre visible */
  .sidebar {
    padding-bottom: 16px !important;
  }
  /* Mejor separación entre items */
  .sidebar-nav .nav-item {
    padding: 12px 14px !important;
    font-size: 14px !important;
    margin-bottom: 2px;
  }
  .nav-section-label {
    padding: 14px 14px 6px !important;
    font-size: 10px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   F102 — Split layout en modal "Crear post" (desktop ≥1024px)
   Izquierda: form + lista archivos. Derecha: preview grande + info.
   Mobile (<1024px): mantiene layout vertical existente.
   ═══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  #wm-modal-post .wm-modal-content { max-width: 1320px !important; }
  #wm-modal-post .wm-modal-body {
    display: grid;
    grid-template-columns: minmax(380px, 1fr) minmax(440px, 1.15fr);
    gap: 22px;
    align-items: start;
    max-height: calc(92vh - 130px);
  }
  #wm-modal-post-left { overflow-y: auto; padding-right: 6px; max-height: calc(92vh - 130px); }
  #wm-modal-post-right {
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    max-height: calc(92vh - 130px);
    overflow-y: auto;
  }
}
@media (max-width: 1023px) {
  /* En mobile/tablet, el panel derecho va debajo del izquierdo */
  #wm-modal-post-right {
    margin-top: 14px;
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #e2e8f0;
  }
}

.wm-preview-large {
  width: 100%;
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  position: relative;
}
.wm-preview-large img,
.wm-preview-large video {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  display: block;
}
.wm-preview-empty {
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 40px 20px;
  font-size: 13px;
}
.wm-preview-empty i { font-size: 44px; opacity: 0.5; display: block; margin-bottom: 12px; }

.wm-preview-info {
  background: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 12.5px;
  color: #334155;
  border: 1px solid #e2e8f0;
}
.wm-preview-info .info-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
}
.wm-preview-info .info-row:last-child { border-bottom: none; }
.wm-preview-info .info-row b { color: #0f172a; font-weight: 600; }
.wm-preview-info .info-row span { color: #64748b; }

/* Pills clicables de archivos (modo manual) */
.wm-upload-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
}
.wm-upload-pill:hover { background: #f1f5f9; border-color: #cbd5e1; }
.wm-upload-pill.active { border-color: #6366f1; background: #eef2ff; box-shadow: 0 2px 6px rgba(99,102,241,0.15); }
.wm-upload-pill-thumb {
  width: 40px; height: 40px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8;
}
.wm-upload-pill-thumb img,
.wm-upload-pill-thumb video { width: 100%; height: 100%; object-fit: cover; }
.wm-upload-pill-info { flex: 1; min-width: 0; }
.wm-upload-pill-name {
  font-size: 12px; font-weight: 600; color: #0f172a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wm-upload-pill-meta { font-size: 10px; color: #64748b; margin-top: 2px; display: flex; gap: 6px; align-items: center; }
.wm-upload-pill-meta .estado-tag {
  padding: 1px 6px; border-radius: 99px; font-weight: 700; font-size: 9px; text-transform: none;
}
.wm-upload-pill-meta .estado-tag.subiendo { background: #dbeafe; color: #1e40af; }
.wm-upload-pill-meta .estado-tag.listo    { background: #d1fae5; color: #065f46; }
.wm-upload-pill-meta .estado-tag.error    { background: #fee2e2; color: #991b1b; }
.wm-upload-pill-meta .estado-tag.cancelado{ background: #f1f5f9; color: #64748b; }
.wm-upload-pill-bar {
  height: 3px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-top: 4px;
}
.wm-upload-pill-bar-fill { height: 100%; background: #6366f1; transition: width .2s; }
.wm-upload-pill-quitar {
  border: none; background: transparent; color: #ef4444; cursor: pointer; font-size: 16px; padding: 4px 6px; flex-shrink: 0;
  border-radius: 4px;
}
.wm-upload-pill-quitar:hover { background: #fee2e2; }

/* F102: Marco PNG superpuesto en preview del modal Crear post (modo manual) */
.wm-video-con-marco { position: relative; display: block; width: 100%; line-height: 0; }
.wm-video-con-marco video,
.wm-video-con-marco img { position: relative; z-index: 1; display: block; max-width: 100%; max-height: 60vh; margin: 0 auto; }
.wm-marco-overlay-preview {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
  z-index: 2 !important;
  object-fit: contain;
  max-height: none !important;
}
