/* Difusión — section styles. Scoped to body[data-active-section="difusion"].
   Sidebar/topbar/main mirror /gestion para coherencia del ecosistema.
   Brand: var(--accent), Cossette Titre en el título del topbar. */

body[data-active-section="difusion"] {
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist', 'Inter Tight', system-ui, -apple-system, sans-serif;
  font-size: var(--wb-text-md);
  -webkit-font-smoothing: antialiased;
}

body[data-active-section="difusion"],
body[data-active-section="difusion"] *,
body[data-active-section="difusion"] *::before,
body[data-active-section="difusion"] *::after {
  box-sizing: border-box;
}

/* App shell */
body[data-active-section="difusion"] .app.difusion-app {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

/* Sidebar */
body[data-active-section="difusion"] .sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100dvh;
  overflow-y: auto;
  z-index: 50;
}
body[data-active-section="difusion"] .sb-header {
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  height: 52px;
}
body[data-active-section="difusion"] .sb-header img {
  height: 26px;
  width: auto;
  object-fit: contain;
  object-position: left center;
  display: block;
}
body[data-active-section="difusion"] .sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
body[data-active-section="difusion"] .sb-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  margin: 1px 8px;
  cursor: pointer;
  color: var(--muted);
  border-radius: var(--wb-radius-md);
  font-size: var(--wb-text-base);
  font-weight: 500;
  transition: all .15s ease;
  text-decoration: none;
}
body[data-active-section="difusion"] .sb-item:hover:not(.df-disabled) {
  background: var(--surface2);
  color: var(--text);
}
body[data-active-section="difusion"] .sb-item.active {
  background: var(--accent-bg, color-mix(in srgb, var(--accent) 14%, transparent));
  color: var(--accent);
}
body[data-active-section="difusion"] .sb-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .7;
}
body[data-active-section="difusion"] .sb-item.active svg { opacity: 1; }
body[data-active-section="difusion"] .sb-item.df-disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}
body[data-active-section="difusion"] .df-pronto {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--surface2);
  color: var(--muted);
  padding: 2px 6px;
  border-radius: var(--wb-radius-sm);
  margin-left: auto;
}

/* Main */
body[data-active-section="difusion"] .difusion-app .main {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body[data-active-section="difusion"] .difusion-app .topbar {
  padding: 18px 24px 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
body[data-active-section="difusion"] .difusion-app .topbar-title {
  font-size: var(--wb-text-xl);
  font-weight: 400;
  color: var(--text);
  flex: 1;
  font-family: 'Cossette Titre', sans-serif;
  letter-spacing: -0.01em;
}
body[data-active-section="difusion"] .difusion-app .topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
body[data-active-section="difusion"] .difusion-app .content {
  flex: 1;
  overflow-y: auto;
  padding: 6px 24px 24px;
}

body[data-active-section="difusion"] .loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  padding: 60px 0;
  font-size: var(--wb-text-md);
}
body[data-active-section="difusion"] .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: df-spin .8s linear infinite;
}
@keyframes df-spin { to { transform: rotate(360deg); } }

/* Cards / forms / tables — reuse from previous iteration */
.df-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--wb-radius-xl);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.df-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 12px; }
.df-card-title { margin: 0; font-size: var(--wb-text-lg); font-weight: 700; color: var(--text); }
.df-card-desc { margin: 2px 0 0; color: var(--muted); font-size: var(--wb-text-sm); line-height: 1.45; }
.df-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

.df-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: var(--wb-radius-md);
  font-size: var(--wb-text-base);
}
.df-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.df-status-dot.ok { background: var(--green); }
.df-status-dot.warn { background: var(--orange); }
.df-status-dot.err { background: var(--red); }
.df-status-meta { color: var(--muted); font-size: var(--wb-text-sm); margin-left: auto; }

.df-form { margin-top: 14px; }
.df-form-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.df-form-row > label {
  font-size: var(--wb-text-sm);
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.df-form-row input,
.df-form-row select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--wb-radius-md);
  padding: 8px 12px;
  color: var(--text);
  font-size: var(--wb-text-base);
  font-family: inherit;
  width: 100%;
}
.df-form-row input:focus,
.df-form-row select:focus { outline: none; border-color: var(--accent); }
.df-input-with-toggle { display: flex; gap: 6px; }
.df-input-with-toggle input { flex: 1; }
.df-toggle-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--wb-radius-md);
  padding: 8px 12px;
  cursor: pointer;
  color: var(--muted);
  font-size: var(--wb-text-sm);
}
.df-toggle-btn:hover { color: var(--accent); border-color: var(--accent); }
.df-form-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.df-help { margin: 14px 0 0; color: var(--muted); font-size: var(--wb-text-sm); line-height: 1.5; }
.df-muted { color: var(--muted); font-size: var(--wb-text-sm); }
.df-cap { text-transform: capitalize; }

.df-table { width: 100%; border-collapse: collapse; font-size: var(--wb-text-base); }
.df-table th {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--dim);
  font-size: var(--wb-text-xs);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}
.df-table td { padding: 11px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.df-table tr:hover td { background: var(--surface2); }
.df-table .df-row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.df-table .df-row-actions button {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  font-size: var(--wb-text-base);
}
.df-table .df-row-actions button:hover { color: var(--accent); }

.df-channel-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--wb-radius-sm);
  padding: 3px 8px;
  font-size: var(--wb-text-sm);
}
.df-channel-badge img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.df-pill-x {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  font-size: var(--wb-text-md);
  line-height: 1;
}
.df-pill-x:hover { color: var(--red); }

.df-empty { color: var(--muted); text-align: center; padding: 30px 0; font-size: var(--wb-text-base); }
.df-empty a { color: var(--accent); text-decoration: none; }
.df-empty a:hover { text-decoration: underline; }

.df-btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--wb-radius-md);
  padding: 8px 16px;
  font-weight: 600;
  font-size: var(--wb-text-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.df-btn:hover { filter: brightness(1.1); }
.df-btn.df-btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.df-btn.df-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Modal local */
.df-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.df-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--wb-radius-xl);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
}
.df-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.df-modal-head h3 { margin: 0; font-size: var(--wb-text-lg); font-weight: 700; color: var(--text); }
.df-modal-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: var(--wb-text-2xl);
  line-height: 1;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--wb-radius-md);
}
.df-modal-close:hover { background: var(--surface2); color: var(--text); }
.df-modal-body { padding: 18px 20px; }
.df-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* Post cards (Hoy / Calendario detail) */
.df-post-card {
  display: grid;
  grid-template-columns: 60px 32px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--wb-radius-lg);
  margin-bottom: 8px;
  background: var(--surface2);
  font-size: var(--wb-text-base);
}
.df-post-time { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.df-post-platform { color: var(--accent); font-size: 18px; text-align: center; }
.df-post-info { min-width: 0; }
.df-post-title { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.df-post-sub { font-size: var(--wb-text-xs); color: var(--muted); margin-top: 2px; }
.df-post-err { font-size: var(--wb-text-xs); color: var(--red); margin-top: 3px; }
.df-post-status { font-size: var(--wb-text-xs); font-weight: 600; display: flex; align-items: center; gap: 5px; white-space: nowrap; }

/* Hoy view */
.df-hours { display: grid; gap: 18px; margin-top: 14px; }
.df-hour-group { display: grid; grid-template-columns: 60px 1fr; gap: 16px; align-items: start; }
.df-hour-label { font-size: var(--wb-text-xs); font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; padding-top: 12px; font-variant-numeric: tabular-nums; }
.df-hour-posts { display: grid; gap: 0; }

/* Calendar */
.df-cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.df-cal-title { margin: 0; font-size: var(--wb-text-lg); font-weight: 700; flex: 1; text-align: center; color: var(--text); }
.df-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--wb-radius-lg);
  padding: 8px;
  background: var(--surface2);
}
.df-cal-dayname { text-align: center; font-size: var(--wb-text-xs); font-weight: 700; color: var(--dim); text-transform: uppercase; padding: 6px 0; letter-spacing: .04em; }
.df-cal-cell {
  min-height: 64px;
  background: var(--surface);
  border-radius: var(--wb-radius-md);
  padding: 6px;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid transparent;
  transition: all .15s;
}
.df-cal-cell:hover { border-color: var(--accent); }
.df-cal-cell.df-cal-empty { background: transparent; cursor: default; }
.df-cal-cell.df-cal-empty:hover { border-color: transparent; }
.df-cal-cell.df-cal-today { background: var(--accent-bg, color-mix(in srgb, var(--accent) 14%, transparent)); }
.df-cal-cell.df-cal-today .df-cal-daynum { color: var(--accent); font-weight: 700; }
.df-cal-cell.df-cal-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg, color-mix(in srgb, var(--accent) 14%, transparent)); }
.df-cal-daynum { font-size: var(--wb-text-sm); color: var(--text); }
.df-cal-count {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--accent);
  color: var(--bg);
  font-size: var(--wb-text-xs);
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--wb-radius-lg);
  min-width: 18px;
  text-align: center;
}
.df-cal-dots { display: flex; gap: 3px; margin-top: auto; flex-wrap: wrap; }
.df-cal-dot { width: 5px; height: 5px; border-radius: 50%; }
.df-cal-detail { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.df-cal-detail h4 { margin: 0 0 10px; font-size: var(--wb-text-base); font-weight: 700; color: var(--text); }

/* Histórico */
.df-status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: var(--wb-text-sm); font-weight: 600; }

/* Express form */
.df-checklist { display: flex; flex-wrap: wrap; gap: 6px; }
.df-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--wb-radius-md);
  padding: 6px 10px;
  font-size: var(--wb-text-sm);
  cursor: pointer;
  transition: all .15s;
}
.df-check:hover { border-color: var(--accent); }
.df-check input { accent-color: var(--accent); }
.df-checklist .df-muted { padding: 6px 0; }

@media (max-width: 768px) {
  body[data-active-section="difusion"] .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  body[data-active-section="difusion"] .sidebar.open { transform: translateX(0); }
  body[data-active-section="difusion"] .difusion-app .main { margin-left: 0; }
}

/* ── WIP banner (sección temporalmente deshabilitada) ─────────────────── */
body[data-active-section="difusion"] .difusion-app.df-wip { display: block; }
body[data-active-section="difusion"] .df-wip .main {
  margin-left: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
body[data-active-section="difusion"] .df-wip .content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
body[data-active-section="difusion"] .df-wip-card {
  max-width: 460px;
  text-align: center;
  padding: 40px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--wb-radius-2xl);
  box-shadow: 0 12px 40px rgba(0,0,0,.06);
}
body[data-active-section="difusion"] .df-wip-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
body[data-active-section="difusion"] .df-wip-title {
  margin: 0 0 10px;
  font-family: 'Cossette Titre', 'Geist', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--text);
  text-transform: uppercase;
}
body[data-active-section="difusion"] .df-wip-text {
  margin: 0;
  font-size: var(--wb-text-md);
  line-height: 1.55;
  color: var(--muted);
}
