/* NDR — Sistema de Gestión Django · Frame.io + Linear inspired */

:root {
  --primary:      #1A1A2E;
  --primary-l:    #252545;
  --accent:       #E63946;
  --success:      #2ECC71;
  --warning:      #F59E0B;
  --info:         #3B82F6;
  --purple:       #8B5CF6;
  --sidebar-w:    240px;
  --topbar-h:     56px;
  --bg:           #F0F4F8;
  --surface:      #FFFFFF;
  --surface-2:    #F8FAFC;
  --border:       #DDE3EC;
  --text:         #1A1A2E;
  --text-secondary: #3D5166;
  --text-muted:   #52687A;
  --radius:       8px;
  --radius-sm:    4px;
  --shadow:       0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.12);
}

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

body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ── Layout ────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.25s;
}

.sidebar-logo {
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.logo-plus { color: var(--accent); font-size: 1.3rem; font-weight: 800; }
.logo-name { color: white; font-weight: 700; font-size: 1rem; }
.sidebar-logo-img { height: 28px; width: auto; object-fit: contain; }
.logo-tag {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  align-self: center;
  margin-top: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sidebar-nav { flex: 1; padding: 0.75rem 0; }
.nav-section {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.35);
  padding: 0.75rem 1.25rem 0.3rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1.25rem;
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  transition: background 0.12s, color 0.12s;
  border-radius: 0;
}
.nav-item:hover { color: white; background: rgba(255,255,255,0.07); }
.nav-item.active { color: white; background: rgba(255,255,255,0.13); font-weight: 500; }
.nav-item i { font-size: 1.15rem; opacity: 0.9; }
.nav-item-sub { padding-left: 2.5rem; font-size: 0.85rem; opacity: 0.85; }
.nav-item-sub i { font-size: 1rem; }
.nav-item-sub.active { opacity: 1; }
.nav-group { display: flex; flex-direction: column; }
.nav-sub { display: flex; flex-direction: column; background: rgba(0,0,0,0.15); }
.nav-sub-item {
  display: block; padding: 0.45rem 1.25rem 0.45rem 3rem;
  font-size: 0.82rem; color: rgba(255,255,255,0.65);
  text-decoration: none; transition: color .15s, background .15s;
}
.nav-sub-item:hover { color: white; background: rgba(255,255,255,0.07); }
.nav-sub-item.active { color: white; font-weight: 600; }

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}
.sidebar-user:hover { background: rgba(255,255,255,0.07); }
.user-avatar, .user-avatar-placeholder {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.user-avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.875rem;
}
.user-info { min-width: 0; }
.user-name { color: white; font-size: 0.8rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.7rem; }
.btn-logout {
  color: rgba(255,255,255,0.4);
  background: none; border: none; cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  display: flex; align-items: center;
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
}
.btn-logout:hover { color: white; background: rgba(255,255,255,0.07); }

/* ── Main wrapper ────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ── Topbar ──────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.sidebar-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; color: var(--text-muted);
}
.topbar-title {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.topbar-title a { color: var(--text-muted); }
.topbar-title a:hover { color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 0.5rem; }
.topbar-actions { display: flex; gap: 0.5rem; }
.topbar-comunicar {
  display: flex; align-items: center; gap: 0.4rem;
  background: none; border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer;
  padding: 0.3rem 0.7rem; font-size: 0.8rem;
  color: var(--text-secondary); white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.topbar-comunicar:hover {
  background: var(--accent); border-color: var(--accent);
  color: white;
}
.comunicar-hint-toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 300;
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--card-bg); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 0.65rem 0.9rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  font-size: 0.83rem; max-width: 340px;
  animation: hint-slide-in 0.2s ease;
}
@keyframes hint-slide-in {
  from { opacity:0; transform: translateY(8px); }
  to   { opacity:1; transform: translateY(0); }
}
.comunicar-hint-check { color: #16a34a; font-size: 1rem; flex-shrink: 0; }
.comunicar-hint-texto { flex: 1; color: var(--text-secondary); }
.comunicar-hint-btn {
  display: flex; align-items: center; gap: 0.25rem;
  background: var(--accent); color: white; border: none;
  border-radius: 5px; padding: 0.3rem 0.65rem;
  font-size: 0.77rem; cursor: pointer; white-space: nowrap;
  transition: opacity 0.15s;
}
.comunicar-hint-btn:hover { opacity: 0.85; }
.comunicar-hint-close { color: var(--text-muted); flex-shrink: 0; }
@media (max-width: 640px) {
  .topbar-comunicar-txt { display: none; }
  .topbar-comunicar { padding: 0.3rem 0.5rem; }
}

/* ── Messages ────────────────────────────────────────── */
.messages-container { padding: 0.75rem 1.5rem 0; }
.alert {
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}
.alert-success { background: #F0FDF4; border: 1px solid #86EFAC; color: #166534; }
.alert-error, .alert-danger { background: #FFF5F5; border: 1px solid #FCA5A5; color: #991B1B; }
.alert-warning { background: #FFFBEB; border: 1px solid #FCD34D; color: #92400E; }
.alert-info { background: #EFF6FF; border: 1px solid #93C5FD; color: #1E40AF; }
.alert-close { background: none; border: none; cursor: pointer; color: inherit; opacity: 0.6; }
.alert-close:hover { opacity: 1; }

/* ── Main content ────────────────────────────────────── */
.main-content { flex: 1; padding: 1.5rem; }
.page-container { max-width: 1100px; }
.page-container.narrow { max-width: 600px; }
.page-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 1.25rem; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius); border: none; cursor: pointer;
  font-size: 0.875rem; font-family: inherit; font-weight: 500;
  transition: filter 0.15s, background 0.15s;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--accent); color: white; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }
.text-danger { color: var(--accent); }
.btn-icon {
  padding: 0.3rem; background: none; border: none; cursor: pointer;
  color: var(--text-muted); border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; font-size: 1rem;
  transition: background 0.12s, color 0.12s;
}
.btn-icon:hover { color: var(--text); background: var(--bg); }
.btn-icon.danger:hover { color: var(--accent); }

/* ── Card ────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.875rem;
}
.card-title { font-size: 0.9rem; font-weight: 600; }
.card-link { font-size: 0.8rem; color: var(--accent); }
.card-link:hover { text-decoration: underline; }
.card.danger-zone { border-color: #FCA5A5; }
.card.danger-zone h3 { color: var(--accent); margin-bottom: 0.5rem; }
.card.danger-zone p { color: var(--text-muted); margin-bottom: 1rem; }

/* ── Progress ────────────────────────────────────────── */
.progress-wrap { background: var(--border); border-radius: 2px; height: 4px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--success); border-radius: 2px; transition: width 0.3s ease; }
.progress-header { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.2rem; }
.progress-overall { margin-bottom: 1rem; }
.progress-pct { font-size: 0.8rem; color: var(--text-muted); }
.progress-cell { display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; }

/* ── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.18rem 0.55rem; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-preproduccion { background: #EFF6FF; color: #3B82F6; }
.badge-rodaje        { background: #FFF7ED; color: #D97706; }
.badge-edicion       { background: #F5F3FF; color: #7C3AED; }
.badge-listo         { background: #ECFDF5; color: #059669; }
.badge-publicado     { background: #F0FDF4; color: #16A34A; }
.badge-prospecto     { background: #F1F5F9; color: #64748B; }
.badge-contactado    { background: #FFF7ED; color: #D97706; }
.badge-confirmado    { background: #EFF6FF; color: #2563EB; }
.badge-realizado     { background: #F0FDF4; color: #16A34A; }
.badge-inactivo      { background: #FFF5F5; color: #991B1B; }
.badge-lg { font-size: 0.85rem; padding: 0.3rem 0.8rem; }
.badge-tipo-documento { background: #EFF6FF; color: #3B82F6; }
.badge-tipo-imagen    { background: #F5F3FF; color: #8B5CF6; }
.badge-tipo-audio     { background: #FFF7ED; color: #D97706; }
.badge-tipo-video_link{ background: #FFF5F5; color: #E63946; }

/* ── Forms ───────────────────────────────────────────── */
.form-group { margin-bottom: 0.85rem; }
.form-group label {
  display: block; font-size: 0.75rem; font-weight: 500;
  color: var(--text-muted); margin-bottom: 0.25rem;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 0.5rem 0.65rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.875rem; font-family: inherit; color: var(--text); background: white;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 70px; }
.field-error { color: var(--accent); font-size: 0.78rem; margin-top: 0.2rem; }
.field-help { color: var(--text-muted); font-size: 0.75rem; margin-top: 0.2rem; }
.form-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 0.75rem; }

/* Sexo selector */
.sexo-options { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.sexo-option { cursor: pointer; }
.sexo-option input[type="radio"] { display: none; }
.sexo-option span {
  display: block; padding: 0.3rem 0.85rem;
  border: 1px solid var(--border); border-radius: 20px;
  font-size: 0.82rem; color: var(--text-muted);
  transition: all 0.15s;
}
.sexo-option input:checked + span {
  background: var(--accent); border-color: var(--accent);
  color: white; font-weight: 600;
}
.sexo-option span:hover { border-color: var(--accent); color: var(--accent); }

/* Mesa sugerida */
.mesas-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.mesa-card {
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); overflow: hidden;
}
.mesa-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.mesa-card-tema { font-weight: 600; font-size: 0.875rem; color: var(--text); flex: 1; }
.mesa-card-actions { display: flex; gap: 0.25rem; align-items: center; }
.mesa-card-notas {
  padding: 0.35rem 0.65rem; font-size: 0.8rem; color: var(--text-muted);
  border-bottom: 1px solid var(--border); white-space: pre-wrap;
}
.mesa-comp-list {
  display: flex; flex-wrap: wrap; gap: 0.3rem;
  padding: 0.45rem 0.65rem;
}
.mesa-comp-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: #EEF2FF; color: #4338CA;
  border: 1px solid #C7D2FE; border-radius: 20px;
  padding: 0.15rem 0.5rem; font-size: 0.78rem; font-weight: 500;
}
.mesa-comp-x {
  background: none; border: none; cursor: pointer;
  color: #6366F1; padding: 0; line-height: 1;
  display: flex; align-items: center; opacity: 0.6;
  transition: opacity .15s;
}
.mesa-comp-x:hover { opacity: 1; }
.mesa-comp-x .ti { font-size: 0.65rem; }
.mesa-comp-empty { font-size: 0.78rem; color: var(--text-muted); font-style: italic; }
.mesa-add-comp-form {
  display: flex; gap: 0.4rem; align-items: center;
  padding: 0.35rem 0.65rem; border-top: 1px dashed var(--border);
}
.mesa-select-sm {
  flex: 1; min-width: 140px; padding: 0.25rem 0.45rem;
  border: 1px solid var(--border); border-radius: 5px;
  font-size: 0.78rem; background: var(--bg); color: var(--text);
}
.mesa-select-sm:focus { outline: none; border-color: var(--accent); }
.mesa-new-form {
  display: flex; flex-direction: column; gap: 0.4rem;
  margin-top: 0.35rem;
}
.mesa-new-form button { align-self: flex-start; }
.mesa-empty { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 0.5rem; }
.mesa-input {
  width: 100%; padding: 0.35rem 0.6rem; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.83rem; background: var(--bg); color: var(--text);
}
.mesa-input:focus { outline: none; border-color: var(--accent); }
.mesa-textarea {
  width: 100%; padding: 0.35rem 0.6rem; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.8rem; background: var(--bg); color: var(--text);
  resize: vertical; font-family: inherit;
}
.mesa-textarea:focus { outline: none; border-color: var(--accent); }

/* ── Dashboard ───────────────────────────────────────── */
.dashboard {}
.alert-banner {
  background: #FFF5F5; border: 1px solid #FCA5A5; border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 0.7rem 1rem; margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: #c0392b;
}
.metrics-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem;
}
.metric-card {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  padding: 1rem 1.1rem; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 0.875rem;
}
.metric-card.alert-card { border-color: #FCA5A5; background: #FFF8F8; }
.metric-icon {
  width: 42px; height: 42px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.metric-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.metric-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.metric-sub { font-size: 0.72rem; color: var(--text-muted); }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.card-full { grid-column: 1 / -1; }

/* Ep mini list */
.ep-mini-list { display: flex; flex-direction: column; gap: 0.1rem; }
.ep-mini-row {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--bg); transition: background 0.1s; border-radius: var(--radius-sm);
}
.ep-mini-row:hover { background: var(--bg); }
.ep-mini-num { font-weight: 600; font-size: 0.8rem; color: var(--text-muted); width: 48px; flex-shrink: 0; }
.ep-mini-info { flex: 1; min-width: 0; }
.ep-mini-tema { font-weight: 500; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-mini-fecha { font-size: 0.72rem; color: var(--text-muted); }
.ep-mini-progress { display: flex; align-items: center; gap: 0.4rem; font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0; }

/* Check mini list */
.check-mini-list { list-style: none; }
.check-mini-list li {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0;
  border-bottom: 1px solid var(--bg); font-size: 0.875rem;
}
.check-mini-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.1rem; display: flex; align-items: center;
  transition: color 0.1s; flex-shrink: 0;
}
.check-mini-btn:hover { color: var(--success); }
.check-mini-bloque { font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0; }
.empty-state-sm.success { color: var(--success); }

/* Activity */
.activity-list { display: flex; flex-direction: column; gap: 0.75rem; }
.activity-item { display: flex; gap: 0.65rem; }
.activity-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.75rem; flex-shrink: 0;
}
.activity-body { flex: 1; min-width: 0; }
.activity-meta { font-size: 0.8rem; }
.activity-text { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.1rem; }
.activity-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }

/* Archivo mini list */
.archivo-mini-list { display: flex; flex-direction: column; }
.archivo-mini-row { display: flex; align-items: center; gap: 0.65rem; padding: 0.5rem 0.25rem; border-bottom: 1px solid var(--bg); transition: background 0.1s; border-radius: var(--radius-sm); }
.archivo-mini-row:hover { background: var(--bg); }
.archivo-mini-icon { font-size: 1.2rem; color: var(--text-muted); flex-shrink: 0; }
.archivo-mini-nombre { font-size: 0.875rem; font-weight: 500; }
.archivo-mini-meta { font-size: 0.72rem; color: var(--text-muted); }

/* ── Formato ──────────────────────────────────────────── */
.bloque-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 0.75rem; }
.bloque-header { display: flex; align-items: center; justify-content: space-between; padding: 0.8rem 1rem; cursor: pointer; user-select: none; transition: background 0.12s; }
.bloque-header:hover { background: var(--bg); }
.bloque-title { font-weight: 600; font-size: 0.9375rem; }
.bloque-meta { display: flex; align-items: center; gap: 0.75rem; }
.bloque-count { font-size: 0.75rem; color: var(--text-muted); }
.bloque-pct { font-size: 0.75rem; color: var(--text-muted); min-width: 30px; text-align: right; }
.bloque-chevron { font-size: 1rem; color: var(--text-muted); transition: transform 0.2s; }
.bloque-body { padding: 0.5rem 1rem 1rem; border-top: 1px solid var(--border); }
.add-item-form { display: flex; gap: 0.5rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.add-item-form input { flex: 1; padding: 0.35rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.875rem; font-family: inherit; }
.add-item-form input:focus { outline: none; border-color: var(--accent); }

/* Checklist */
.checklist { list-style: none; }
.checklist-item { padding: 0.45rem 0; border-bottom: 1px solid var(--bg); }
.checklist-item:last-child { border-bottom: none; }
.checklist-item.done .item-label { text-decoration: line-through; color: var(--text-muted); }
.checklist-row { display: flex; align-items: flex-start; gap: 0.55rem; }
.check-btn {
  background: none; border: none; cursor: pointer;
  color: var(--border); font-size: 1.2rem; flex-shrink: 0;
  display: flex; align-items: center; transition: color 0.15s;
  margin-top: 1px;
}
.check-btn:hover { color: var(--success); }
.check-btn.checked { color: var(--success); }
.check-btn.static { cursor: default; }
.item-content { flex: 1; min-width: 0; }
.item-label { font-size: 0.875rem; }
.item-meta { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }
.item-notas { font-size: 0.78rem; color: var(--text-muted); font-style: italic; margin-top: 0.2rem; background: var(--bg); padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); }
.item-meta-badge { font-size: 0.7rem; background: var(--success); color: white; padding: 0.1rem 0.4rem; border-radius: 20px; flex-shrink: 0; }
.item-actions { display: flex; gap: 0.1rem; opacity: 0; transition: opacity 0.15s; flex-shrink: 0; }
.checklist-item:hover .item-actions { opacity: 1; }
.notas-inline { width: 100%; font-size: 0.8rem; padding: 0.3rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; resize: none; }
.notas-inline:focus { outline: none; border-color: var(--accent); }

/* ── Episodios ────────────────────────────────────────── */
.filter-bar { margin-bottom: 1rem; }
.filter-form { display: flex; gap: 0.65rem; flex-wrap: wrap; align-items: center; }
.filter-form select, .filter-form input { padding: 0.4rem 0.65rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.875rem; font-family: inherit; background: var(--surface); }
.filter-form select:focus, .filter-form input:focus { outline: none; border-color: var(--accent); }

.kanban-filters {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
}
.kanban-filter-group {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.3rem 0.65rem;
}
.kanban-filter-label {
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
  white-space: nowrap; user-select: none;
}
.kanban-filter-select {
  border: none; background: transparent; font-size: 0.875rem;
  font-family: inherit; color: var(--text); cursor: pointer;
  outline: none; padding: 0.1rem 0.2rem;
}
.kanban-filter-nombre {
  display: flex; align-items: center; gap: 0.2rem;
}
.kanban-filter-input {
  border: none; background: transparent; font-size: 0.875rem;
  font-family: inherit; color: var(--text); outline: none;
  width: 130px; padding: 0.1rem 0.2rem;
}
.kanban-filter-input::placeholder { color: var(--text-muted); }
.kanban-filter-clear {
  font-size: 0.8rem; color: var(--text-muted); text-decoration: none;
  display: flex; align-items: center; gap: 0.25rem;
  padding: 0.3rem 0.6rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  transition: color .15s, border-color .15s;
}
.kanban-filter-clear:hover { color: var(--accent); border-color: var(--accent); }

.episodes-table-wrap { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.episodes-table { width: 100%; border-collapse: collapse; }
.episodes-table th { background: var(--primary); color: rgba(255,255,255,0.8); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; padding: 0.7rem 1rem; text-align: left; }
.episodes-table td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--bg); vertical-align: middle; }
.episodes-table tr:last-child td { border-bottom: none; }
.ep-row { cursor: pointer; transition: background 0.1s; }
.ep-row:hover td { background: var(--surface-2); }
.ep-pub-prevista { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; color: #92400E; background: #FEF3C7; border: 1px solid #FCD34D; border-radius: 4px; padding: 0.05rem 0.35rem; margin-left: 0.25rem; vertical-align: middle; }

/* Episode detail */
.episode-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1rem; align-items: start; }
.episode-hero { }
.episode-hero-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.episode-num { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.episode-tema { font-size: 1.5rem; font-weight: 700; line-height: 1.2; margin-top: 0.2rem; }
.episode-fecha { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.4rem; }
.episode-status-info { text-align: right; flex-shrink: 0; }
.episode-notas { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.75rem; padding: 0.5rem; background: var(--bg); border-radius: var(--radius-sm); }
.episode-hero-fechas { margin: 0.75rem 0; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.episode-hero-fechas .prepro-fecha-item { margin-bottom: 0.5rem; }
.episode-hero-fechas .prepro-fecha-item:last-child { margin-bottom: 0; }
.episode-progress-bar { margin-top: 0.5rem; }
.episode-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 1rem; }
.ep-tab { padding: 0.45rem 1rem; background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-family: inherit; font-size: 0.875rem; color: var(--text-muted); margin-bottom: -2px; transition: color 0.15s, border-color 0.15s; }
.ep-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.tab-badge { font-size: 0.7rem; background: var(--bg); padding: 0.1rem 0.35rem; border-radius: 20px; margin-left: 0.3rem; }
.ep-tab-panel { display: none; }
.ep-tab-panel.active { display: block; }

/* Archivos grid */
.archivos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.75rem; }
.archivos-grid-full { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.archivo-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: box-shadow 0.15s, transform 0.15s;
  background: var(--surface); display: block;
}
.archivo-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.archivo-card-icon {
  height: 90px; display: flex; align-items: center; justify-content: center;
  background: var(--bg); font-size: 2rem; color: var(--text-muted);
}
.archivo-card-icon.imagen { background: #F5F3FF; }
.archivo-thumbnail { width: 100%; height: 100%; object-fit: cover; }
.archivo-card-info { padding: 0.5rem 0.6rem; }
.archivo-card-nombre { font-size: 0.78rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.archivo-card-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; }
.archivo-card-fecha { font-size: 0.68rem; color: var(--text-muted); }
.archivo-comments { position: absolute; top: 0.4rem; right: 0.4rem; font-size: 0.7rem; color: var(--text-muted); }

/* Wrapper con botón de eliminar sobre la card */
.archivo-card-wrap { position: relative; }
.archivo-card-delete {
  position: absolute;
  top: 0.4rem; right: 0.4rem;
  background: rgba(230, 57, 70, 0.85);
  color: white; border: none; border-radius: var(--radius-sm);
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.8rem;
  opacity: 0; transition: opacity 0.15s;
  z-index: 2;
}
.archivo-card-wrap:hover .archivo-card-delete { opacity: 1; }
.archivo-card-delete:hover { background: var(--accent); }

/* Archivo detail */
.archivo-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; align-items: start; }
.preview-imagen { max-width: 100%; border-radius: var(--radius); }

.preview-placeholder { text-align: center; padding: 3rem 1rem; }
.preview-placeholder i { font-size: 3rem; color: var(--text-muted); display: block; margin-bottom: 0.75rem; }
.preview-filename { font-size: 1rem; font-weight: 500; margin-bottom: 1rem; }

/* Toolbar sobre el preview */
.preview-toolbar {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 0.75rem; flex-wrap: wrap;
}
.preview-type-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 0.2rem 0.65rem;
  font-size: 0.78rem; font-weight: 500; color: var(--text-muted);
}

/* Render de Word (mammoth) */
.doc-render-area {
  min-height: 200px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  background: white;
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #111;
  max-height: 70vh;
  overflow-y: auto;
}
/* Estilos para el HTML generado por mammoth */
.doc-render-area h1 { font-size: 1.5rem; font-weight: 700; margin: 0.75rem 0 0.35rem; }
.doc-render-area h2 { font-size: 1.25rem; font-weight: 600; margin: 0.65rem 0 0.3rem; }
.doc-render-area h3 { font-size: 1.1rem; font-weight: 600; margin: 0.5rem 0 0.25rem; }
.doc-render-area p  { margin-bottom: 0.65rem; }
.doc-render-area table { border-collapse: collapse; width: 100%; margin: 0.75rem 0; }
.doc-render-area td, .doc-render-area th {
  border: 1px solid #ccc; padding: 0.35rem 0.6rem; font-size: 0.9rem;
}
.doc-render-area th { background: #f5f5f5; font-weight: 600; }
.doc-render-area ul, .doc-render-area ol { margin: 0.4rem 0 0.65rem 1.5rem; }
.doc-render-area li { margin-bottom: 0.2rem; }
.doc-render-area strong, .doc-render-area b { font-weight: 700; }
.doc-render-area em, .doc-render-area i { font-style: italic; }
.doc-render-area img { max-width: 100%; height: auto; }

/* Render de TXT */
.txt-render-area {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  background: #1e1e2e;
  color: #CDD6F4;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60vh;
  overflow-y: auto;
}

/* Audio preview */
.preview-audio {
  text-align: center;
  padding: 2.5rem 1rem;
}
.preview-audio audio {
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.archivo-nombre { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.75rem; }
.archivo-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.75rem; font-size: 0.825rem; }
.meta-label { color: var(--text-muted); display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.3px; }
.archivo-descripcion { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }

/* Upload */
.upload-context-banner { background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: var(--radius); padding: 0.6rem 1rem; margin-bottom: 1rem; font-size: 0.875rem; color: var(--info); display: flex; align-items: center; gap: 0.4rem; }
.upload-tip { background: var(--bg); border-radius: var(--radius-sm); padding: 0.6rem 0.75rem; font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: flex-start; gap: 0.4rem; margin-top: 0.5rem; }

/* ── Kanban ───────────────────────────────────────────── */
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; align-items: start; }
.kanban-col { background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border); }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 0.9rem; background: var(--surface); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.kanban-col-title { font-size: 0.875rem; font-weight: 600; }
.kanban-col-count { background: var(--border); color: var(--text-muted); border-radius: 20px; padding: 0.1rem 0.5rem; font-size: 0.72rem; font-weight: 600; }
.kanban-col-desc { font-size: 0.72rem; color: var(--text-muted); padding: 0.35rem 0.9rem 0; }
.kanban-col-body { padding: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; min-height: 150px; }
.kanban-empty { text-align: center; padding: 1.5rem 0.5rem; font-size: 0.8rem; color: var(--text-muted); }
.kanban-card { background: var(--surface); border-radius: 6px; border: 1px solid var(--border); padding: 0.65rem 0.75rem; box-shadow: var(--shadow); }
.kanban-card-name { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.2rem; color: inherit; text-decoration: none; display: block; }
.kanban-card-name:hover { color: var(--accent); }
.kanban-card-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 0.3rem; }
.tag-chip-sm {
  background: #F5F3FF; color: #7C3AED;
  border-radius: 20px; padding: 0.1rem 0.45rem;
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.2px;
}
.kanban-card-perfil { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.2rem; }
.kanban-card-ep { font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.25rem; margin-bottom: 0.2rem; }
.kanban-card-contacto { font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.25rem; }
.kanban-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; padding-top: 0.4rem; border-top: 1px solid var(--border); }
.kanban-card-actions { display: flex; gap: 0.1rem; }
.estado-select-mini { font-size: 0.72rem; border: 1px solid var(--border); border-radius: 4px; padding: 0.15rem 0.3rem; background: var(--bg); cursor: pointer; }

/* Invitados chips */
.invitados-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.invitado-chip { display: flex; align-items: center; gap: 0.4rem; background: var(--bg); border-radius: var(--radius); padding: 0.3rem 0.6rem; font-size: 0.8rem; }

/* ── Comentarios ─────────────────────────────────────── */
.episode-comments, .archivo-comments { position: sticky; top: calc(var(--topbar-h) + 1rem); }
.comments-panel { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.comments-header { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.875rem; font-weight: 600; display: flex; align-items: center; gap: 0.4rem; background: var(--surface-2); }
#comments-list, #file-comments-list { padding: 0.75rem 1rem; max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 0; }
.comentario { padding: 0.6rem 0; border-bottom: 1px solid var(--bg); }
.comentario:last-child { border-bottom: none; }
.comentario-reply { margin-left: 1rem; padding-left: 0.75rem; border-left: 2px solid var(--border); }
.comentario-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
.mini-avatar { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 0.65rem; flex-shrink: 0; }
.comentario-meta { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; font-size: 0.78rem; }
.comentario-rol { font-size: 0.7rem; }
.comentario-time { font-size: 0.7rem; color: var(--text-muted); }
.comentario-texto { font-size: 0.85rem; line-height: 1.5; margin-left: 1.6rem; }
.comentario-replies { margin-top: 0.5rem; }
.comentario-actions { margin-left: auto; }
.btn-reply { background: none; border: none; cursor: pointer; font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.25rem; margin-left: 1.6rem; margin-top: 0.35rem; transition: color 0.1s; }
.btn-reply:hover { color: var(--accent); }
.reply-textarea { width: 100%; padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.8rem; resize: none; }
.comment-form-wrap { border-top: 1px solid var(--border); padding: 0.75rem; }
.comment-form-wrap textarea { width: 100%; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.875rem; resize: none; }
.comment-form-wrap textarea:focus { outline: none; border-color: var(--accent); }
.comment-form-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; }
.comment-form-user { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--text-muted); }

/* ── Users ───────────────────────────────────────────── */
.users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.user-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 1rem; box-shadow: var(--shadow); }
.user-card-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; }
.user-avatar-lg { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-avatar-lg.placeholder { display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 1.1rem; }
.user-card-name { font-weight: 600; }
.user-card-username { font-size: 0.78rem; color: var(--text-muted); }
.user-card-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.user-card-bio { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.user-card-actions { display: flex; gap: 0.4rem; }

/* ── Tags widget ─────────────────────────────────────── */
.tags-widget {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.tags-widget:focus-within { border-color: var(--accent); }

/* Área de chips seleccionados */
.tags-selected-area {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  min-height: 28px; align-items: center;
}
.tags-empty-hint { font-size: 0.78rem; color: var(--text-muted); font-style: italic; }

.tag-chip-active {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: #1A1A2E; color: white;
  border-radius: 20px; padding: 0.2rem 0.35rem 0.2rem 0.65rem;
  font-size: 0.8rem; font-weight: 500;
}
.tag-chip-remove {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.6); display: flex; align-items: center;
  padding: 0.1rem; border-radius: 50%;
  transition: color 0.1s, background 0.1s;
  font-size: 0.75rem;
}
.tag-chip-remove:hover { color: white; background: rgba(255,255,255,0.15); }
.tag-chip-remove i { font-size: 0.75rem; }

/* Botones predefinidos */
.tags-predefined-row {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}
.tag-predefined-btn {
  background: var(--bg); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 0.25rem 0.75rem; font-size: 0.8rem;
  cursor: pointer; font-family: inherit; font-weight: 500;
  transition: all 0.15s;
}
.tag-predefined-btn:hover {
  border-color: var(--primary); color: var(--primary);
  background: white;
}
.tag-predefined-btn.active {
  background: var(--primary); color: white;
  border-color: var(--primary);
}

/* Input para tag personalizado */
.tags-custom-row {
  display: flex; gap: 0.4rem; align-items: center;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}
.tags-custom-input {
  flex: 1; padding: 0.35rem 0.6rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.875rem; font-family: inherit;
  background: var(--bg);
}
.tags-custom-input:focus { outline: none; border-color: var(--accent); background: white; }

/* ── Login ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--primary);
}
.login-card {
  background: var(--surface); border-radius: var(--radius); padding: 2rem 2.5rem;
  width: 100%; max-width: 380px; box-shadow: var(--shadow-md);
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo .logo-plus { font-size: 2rem; }
.login-logo .logo-name { font-size: 1.5rem; color: var(--primary); }
.login-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }
.login-card .form-group input { padding: 0.65rem 0.75rem; font-size: 0.9rem; }

/* ── Empty states ────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; opacity: 0.35; }
.empty-state p { margin-bottom: 1rem; }
.empty-state-sm { text-align: center; padding: 1.25rem 0.5rem; color: var(--text-muted); font-size: 0.85rem; }
.empty-state-sm i { font-size: 1.5rem; display: block; margin-bottom: 0.35rem; opacity: 0.35; }

/* ── Misc ────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ── Dashboard nuevo ────────────────────────────────── */

/* 4 métricas superiores */
.metrics-grid-3 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

/* 4 secciones de episodios */
.ep-sections-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.ep-section { padding: 0; overflow: hidden; }

.ep-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--border);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.ep-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.ep-section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ep-section-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

.ep-section-count {
  background: var(--border);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 0.1rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
}

.ep-section-ver-todos {
  font-size: 0.78rem;
  color: var(--accent);
  flex-shrink: 0;
}

.ep-section-list {
  display: flex;
  flex-direction: column;
}

.ep-section-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--bg);
  transition: background 0.1s;
  color: var(--text);
}
.ep-section-row:last-child { border-bottom: none; }
.ep-section-row:hover { background: var(--surface-2); }
.ep-section-row.muted { opacity: 0.75; }
.ep-section-row.muted:hover { opacity: 1; }

.ep-row-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 44px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ep-row-info { flex: 1; min-width: 0; }
.ep-row-tema { font-size: 0.875rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-row-meta { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.1rem; font-size: 0.72rem; color: var(--text-muted); flex-wrap: wrap; }
.ep-row-progress { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.ep-row-pct { font-size: 0.7rem; color: var(--text-muted); width: 28px; text-align: right; }
.ep-row-rocket { font-size: 1.1rem; color: #10B981; flex-shrink: 0; }
.ep-row-check { font-size: 1.1rem; color: #9CA3AF; flex-shrink: 0; }

.ep-section-empty {
  padding: 1.25rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.ep-section-empty i { font-size: 1rem; opacity: 0.6; }

.ep-section-add {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  background: var(--surface-2);
  transition: color 0.1s, background 0.1s;
}
.ep-section-add:hover { color: var(--accent); background: #FFF5F5; }

/* Grid de actividad */
.activity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.activity-role {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--bg);
}

.archivo-activity-row { color: var(--text); }
.archivo-activity-row:hover { background: var(--surface-2); }
.archivo-activity-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Producción ─────────────────────────────────────── */
.prod-page { max-width: 960px; }
.prod-progress-bar { margin-bottom: 1rem; }

/* Bloque header con dot de color */
.bloque-header-left { display: flex; align-items: center; gap: 0.5rem; }
.bloque-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.bloque-dot-num-1 { background: #3B82F6; }
.bloque-dot-num-2 { background: #F59E0B; }
.bloque-dot-num-3 { background: #8B5CF6; }
.bloque-dot-num-4 { background: #10B981; }
.bloque-dot-num-5 { background: #E63946; }
.bloque-dot-num-6 { background: #6B7280; }
.bloque-num { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); }
.bloque-subtitle { font-size: 0.72rem; color: var(--text-muted); font-weight: 400; }
.bloque-count-badge {
  background: var(--border); color: var(--text-muted);
  border-radius: 20px; padding: 0.1rem 0.55rem;
  font-size: 0.75rem; font-weight: 600;
}

/* Sub-bloques dentro de un bloque */
.sub-bloque-header {
  font-size: 0.78rem; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 0.6rem 0 0.3rem;
  display: flex; align-items: center; gap: 0.35rem;
  border-top: 1px solid var(--bg);
  margin-top: 0.5rem;
}
.sub-bloque-header:first-child { border-top: none; margin-top: 0; }
.sub-bloque-divider { height: 1px; background: var(--border); margin: 0.75rem 0; }

/* Item label row con badge */
.item-label-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* Badge de count de archivos (siempre visible) */
.item-file-count {
  display: inline-flex; align-items: center; gap: 0.2rem;
  background: #ECFDF5; color: #059669;
  border: 1px solid #6EE7B7;
  border-radius: 20px; padding: 0.1rem 0.45rem;
  font-size: 0.7rem; font-weight: 600;
  white-space: nowrap;
}
.item-file-count i { font-size: 0.7rem; }

/* Item con archivos adjuntos — borde izquierdo verde */
.checklist-item.has-files {
  border-left: 3px solid #10B981;
  padding-left: 0.5rem;
}

/* Item template hint */
.item-template-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.15rem;
  display: flex; align-items: center; gap: 0.25rem;
}
.item-template-hint i { font-size: 0.75rem; }

/* Botón de upload cuando ya tiene archivos */
.has-file-btn { color: #059669 !important; }
.has-file-btn:hover { background: #ECFDF5 !important; }

/* Fila de archivos adjuntos — debajo del label */
.item-archivos-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.45rem 0 0.2rem 2rem;
  padding: 0.5rem 0.65rem;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.item-archivos-label {
  font-size: 0.72rem; font-weight: 600;
  color: #059669; white-space: nowrap;
  display: flex; align-items: center; gap: 0.2rem;
  padding-top: 0.1rem;
}
.item-archivos-list {
  display: flex; flex-wrap: wrap; gap: 0.4rem; flex: 1;
}
.item-archivo-pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: white; color: #065F46;
  border: 1px solid #6EE7B7;
  border-radius: 20px; padding: 0.2rem 0.6rem;
  font-size: 0.78rem; font-weight: 500;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.item-archivo-pill:hover { background: #ECFDF5; border-color: #10B981; }
.item-archivo-pill i { font-size: 0.9rem; }
.pill-size { font-size: 0.68rem; color: #6EE7B7; margin-left: 0.1rem; }

/* Wrapper pill con botón de eliminar */
.pill-wrapper { display: inline-flex; align-items: center; gap: 0.2rem; }
.pill-delete {
  background: none; border: none; cursor: pointer;
  color: #9CA3AF; padding: 0.1rem 0.2rem;
  border-radius: 4px; font-size: 0.8rem;
  display: flex; align-items: center;
  transition: color 0.12s, background 0.12s;
}
.pill-delete:hover { color: var(--accent); background: #FFF5F5; }

/* Upload inline form */
.upload-inline-form {
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
  padding: 0.5rem; background: var(--bg); border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

/* Roster de invitados */
.roster-header { background: #FFF5F5 !important; }
.roster-header:hover { background: #FEE2E2 !important; }

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

.roster-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.roster-card-header {
  display: flex; align-items: flex-start; gap: 0.5rem;
  margin-bottom: 0.35rem; flex-wrap: wrap;
}
.roster-card-name { font-weight: 600; font-size: 0.9rem; color: inherit; text-decoration: none; }
.roster-card-name:hover { color: var(--accent); }

.roster-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.tag-chip {
  background: #F5F3FF; color: #7C3AED;
  border-radius: 20px; padding: 0.1rem 0.45rem;
  font-size: 0.7rem; font-weight: 500;
}

.roster-card-perfil { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.2rem; }
.roster-card-contacto { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.25rem; margin-bottom: 0.2rem; }
.roster-card-notas { font-size: 0.75rem; color: var(--text-muted); font-style: italic; background: var(--bg); padding: 0.25rem 0.4rem; border-radius: 4px; margin-bottom: 0.35rem; }

.roster-assign-form {
  display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap;
  margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border);
}
.roster-ep-select {
  flex: 1; min-width: 140px;
  padding: 0.3rem 0.5rem; border: 1px solid var(--border);
  border-radius: 4px; font-size: 0.78rem; font-family: inherit;
  background: white;
}
.roster-ep-select:focus { outline: none; border-color: var(--accent); }

/* prod-checklist más compacta */
.prod-item .item-actions { gap: 0.2rem; }

/* ── Print ───────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .bloque-header .btn-icon, .add-item-form { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .bloque-body { display: block !important; }
}

/* ── Panel de traslado expandible ───────────────────── */
.seg-row-wrap { display: flex; flex-direction: column; }

.traslado-detail-btn { color: #CBD5E1; }
.traslado-detail-btn.has-data { color: var(--info); }
.traslado-detail-btn:hover { color: var(--info) !important; }

.traslado-panel-wrap {
  margin: 0 0.25rem 0.5rem;
  border-left: 3px solid var(--info);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.traslado-panel {
  background: #EFF6FF; border: 1px solid #BFDBFE;
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.75rem 1rem;
}

.traslado-panel-header {
  font-size: 0.8rem; font-weight: 600; color: #1D4ED8;
  display: flex; align-items: center; gap: 0.4rem;
  margin-bottom: 0.625rem;
}

.traslado-panel-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
}

.traslado-field { display: flex; flex-direction: column; gap: 0.2rem; }
.traslado-field-full { grid-column: 1 / -1; }

.traslado-label {
  font-size: 0.72rem; font-weight: 600;
  color: #3B82F6; text-transform: uppercase; letter-spacing: 0.4px;
}

.traslado-input {
  font-size: 0.85rem; font-family: inherit;
  padding: 0.3rem 0.45rem;
  border: 1px solid #BFDBFE; border-radius: var(--radius-sm);
  background: white; color: var(--text); width: 100%;
  transition: border-color .15s;
}
.traslado-input:focus { outline: none; border-color: #3B82F6; }
.traslado-input::placeholder { color: #93C5FD; }

.traslado-textarea { resize: vertical; min-height: 3rem; }

.traslado-ro {
  font-size: 0.85rem; color: var(--text);
  padding: 0.2rem 0;
}

/* ── Secciones de Preproducción ──────────────────────── */
.prepro-section {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.prepro-section:last-child { border-bottom: none; }

.prepro-bloque-header {
  font-size: 0.95rem; font-weight: 700;
  color: var(--text);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 0.875rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.prepro-section-title {
  font-size: 0.72rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 0.625rem;
}

.prepro-auto-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0; color: var(--text-muted);
}
.prepro-auto-item.done { color: var(--text); }
.prepro-auto-icon { font-size: 1.1rem; flex-shrink: 0; }
.prepro-auto-item.done .prepro-auto-icon { color: var(--success); }
.prepro-auto-label { font-size: 0.875rem; font-weight: 500; }
.prepro-auto-badge {
  margin-left: auto; font-size: 0.75rem; font-weight: 600;
  background: #ECFDF5; color: #059669;
  border: 1px solid #6EE7B7; border-radius: 20px; padding: 0.1rem 0.5rem;
}
.prepro-auto-hint { font-size: 0.78rem; color: var(--text-muted); font-style: italic; }

/* Fechas de rodaje inline */
#fecha-rodaje-{ padding: 0; }

.prepro-fecha-item {
  margin: 0.5rem 0;
  padding: 0.5rem 0;
  border-top: 1px solid var(--bg);
}
.prepro-fecha-item:first-child { border-top: none; }

/* Fechas tentativas */
.fecha-tent-list {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.fecha-tent-chip {
  display: flex; align-items: center; gap: 0.3rem;
  background: #FEF3C7; border: 1px solid #FCD34D;
  border-radius: 6px; padding: 0.2rem 0.5rem;
  font-size: 0.8rem; font-weight: 500; color: #92400E;
}
.fecha-tent-remove {
  background: none; border: none; cursor: pointer;
  color: #B45309; padding: 0; line-height: 1;
  display: flex; align-items: center;
  opacity: 0.6; transition: opacity .15s;
}
.fecha-tent-remove:hover { opacity: 1; }
.fecha-tent-remove .ti { font-size: 0.75rem; }
.fecha-tent-confirm {
  background: none; border: none; cursor: pointer;
  color: #15803D; padding: 0; line-height: 1;
  opacity: 0.6; transition: opacity .15s;
}
.fecha-tent-confirm:hover { opacity: 1; }
.fecha-tent-confirm .ti { font-size: 0.75rem; }
.fecha-tent-form {
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
  margin-top: 0.35rem;
}

.prepro-fecha-label {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.875rem; font-weight: 500; margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.prepro-fecha-input {
  width: 100%; font-size: 0.85rem; font-family: inherit;
  padding: 0.35rem 0.5rem; resize: none; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  transition: border-color .15s, background .15s;
}
.prepro-fecha-input:hover { border-color: #94a3b8; background: var(--surface); }
.prepro-fecha-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.prepro-fecha-input::placeholder { color: #CBD5E1; font-style: italic; }

.prepro-fecha-ro {
  font-size: 0.85rem; color: var(--text);
  background: var(--surface-2); padding: 0.35rem 0.5rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.prepro-fecha-empty { font-size: 0.82rem; color: #CBD5E1; font-style: italic; }

.prepro-fecha-confirmed-fields {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.prepro-fecha-input-sm {
  font-size: 0.83rem; padding: 0.25rem 0.45rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); width: 130px;
}
.prepro-fecha-input-sm:focus { outline: none; border-color: var(--accent); }
.prepro-fecha-link {
  font-size: 0.8rem; color: var(--accent); text-decoration: none;
  display: flex; align-items: center; gap: 0.2rem;
}
.prepro-fecha-link:hover { text-decoration: underline; }

.prepro-empty-guests {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; color: var(--text-muted);
  padding: 0.5rem 0;
}
.prepro-empty-guests a { color: var(--accent); text-decoration: none; }

/* Filas compactas de seguimiento por invitado */
.seg-rows-list { display: flex; flex-direction: column; gap: 0; margin: 0.375rem 0; }

.seg-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.45rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background .1s;
}
.seg-row:hover { background: var(--surface-2); }

.seg-row-name {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.875rem; font-weight: 500; min-width: 0;
}
.badge-sm { font-size: 0.68rem !important; padding: 0.05rem 0.35rem !important; }

.seg-row-checks { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.seg-card-checks {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: unset;
}

.seg-row-check {
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
}
.seg-row-check-label {
  font-size: 0.63rem; color: var(--text-muted);
  white-space: nowrap;
}

.seg-icon-btn {
  background: none; border: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #CBD5E1; font-size: 1.05rem;
  transition: color .15s, background .15s;
}
.seg-icon-btn.active { color: var(--success); }
.seg-icon-btn:not(.static):hover { color: var(--text); background: var(--bg); }
.seg-icon-btn.static { cursor: default; }

/* ── Producción: index con boxes ─────────────────────── */
.prod-index-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 1rem;
}
.prod-index-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.2rem; }
.prod-index-sub   { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

.prod-box-roster {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.875rem 1rem;
  margin-bottom: 1rem;
}
.prod-box-roster-left { display: flex; align-items: center; gap: 0.75rem; }
.prod-box-roster-title { font-weight: 600; font-size: 0.95rem; }
.prod-box-roster-sub   { font-size: 0.78rem; color: var(--text-muted); }

.prod-boxes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.prod-box {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none; color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .1s;
  cursor: pointer;
}
.prod-box:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.prod-box-top {
  display: flex; align-items: center; gap: 0.625rem;
  margin-bottom: 0.75rem;
}
.prod-box-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: white; flex-shrink: 0;
}
.prod-box-num.bloque-dot-num-1 { background: #3B82F6; }
.prod-box-num.bloque-dot-num-2 { background: #F59E0B; }
.prod-box-num.bloque-dot-num-3 { background: #8B5CF6; }
.prod-box-num.bloque-dot-num-4 { background: #10B981; }
.prod-box-num.bloque-dot-num-5 { background: #E63946; }
.prod-box-num.bloque-dot-num-6 { background: #6B7280; }

.prod-box-title {
  font-size: 1rem; font-weight: 700; margin: 0; flex: 1;
  letter-spacing: -0.01em;
}
.prod-box-count {
  font-size: 0.75rem; font-weight: 600;
  background: var(--bg); color: var(--text-muted);
  border-radius: 20px; padding: 0.15rem 0.55rem;
  flex-shrink: 0;
}

.prod-box-subs {
  display: flex; flex-direction: column; gap: 0.25rem;
  margin-bottom: 0.875rem; flex: 1;
}
.prod-sub-chip {
  font-size: 0.78rem; font-weight: 400;
  color: var(--text-muted);
  background: none; border: none;
  padding: 0;
  display: flex; align-items: center; gap: 0.35rem;
}
.prod-sub-chip::before {
  content: '·';
  color: var(--border);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.prod-box-footer {
  font-size: 0.8rem; color: var(--text-muted);
  display: flex; align-items: center; justify-content: flex-end;
  margin-top: auto; padding-top: 0.5rem;
  border-top: 1px solid var(--bg);
  transition: color .15s;
}
.prod-box:hover .prod-box-footer { color: var(--accent); }

/* Bloque detail */
.bloque-detail-header {
  display: flex; align-items: center; justify-content: flex-end;
  margin-bottom: 1.25rem;
}
.bloque-detail-meta { display: flex; align-items: center; gap: 0.75rem; }
.bloque-detail-count {
  font-size: 0.82rem; color: var(--text-muted);
  background: var(--bg); padding: 0.2rem 0.6rem;
  border-radius: 20px;
}
.bloque-detail-section-title {
  font-size: 0.78rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 0.35rem;
  margin: 1.25rem 0 0.625rem;
}
.bloque-detail-section-title:first-child { margin-top: 0; }
.bloque-detail-add {
  margin-top: 1.5rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.bloque-detail-add form {
  display: flex; gap: 0.5rem;
}
.bloque-detail-add input {
  flex: 1; padding: 0.4rem 0.6rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.875rem; font-family: inherit;
}
.bloque-detail-add input:focus { outline: none; border-color: var(--accent); }

@media (max-width: 900px) {
  .prod-boxes-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .prod-boxes-grid { grid-template-columns: 1fr; }
}

/* ── Recursos de Producción (sin checkbox) ───────────── */
.recursos-list {
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 0.25rem 0;
}

.recurso-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  background: var(--surface);
  transition: border-color .15s;
}
.recurso-item:focus-within { border-color: #94a3b8; }

.recurso-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 0.5rem; margin-bottom: 0.3rem;
}
.recurso-label-wrap { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.recurso-label {
  font-weight: 600; font-size: 0.9rem; color: var(--text);
}
.recurso-actions { display: flex; gap: 0.15rem; flex-shrink: 0; }

.recurso-desc {
  font-size: 0.78rem; color: var(--text-muted);
  font-style: italic; margin-bottom: 0.5rem;
  display: flex; align-items: center; gap: 0.3rem;
}
.recurso-desc::before { content: ""; display: inline-block; width: 3px; height: 3px; background: var(--text-muted); border-radius: 50%; flex-shrink: 0; }

.recurso-cuerpo-wrap { margin: 0.35rem 0; }
.recurso-cuerpo-input {
  width: 100%; min-height: 80px;
  font-size: 0.875rem; font-family: inherit; line-height: 1.55;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  resize: none; overflow: hidden;
  transition: border-color .15s, background .15s;
}
.recurso-cuerpo-input:hover { border-color: #94a3b8; background: var(--surface); }
.recurso-cuerpo-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.recurso-cuerpo-input::placeholder { color: #CBD5E1; font-style: italic; }

.recurso-cuerpo-ro {
  font-size: 0.875rem; line-height: 1.6; color: var(--text);
  background: var(--surface-2); padding: 0.5rem 0.625rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  white-space: pre-wrap; word-break: break-word;
}
.recurso-cuerpo-empty {
  font-size: 0.82rem; color: #CBD5E1; font-style: italic;
  padding: 0.35rem 0.25rem;
}

.recurso-link-wrap { margin: 0.35rem 0; }
.recurso-link-row {
  display: flex; align-items: center; gap: 0.5rem;
}
.recurso-link-input {
  flex: 1; padding: 0.4rem 0.625rem;
  font-size: 0.875rem; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  transition: border-color .15s, background .15s;
}
.recurso-link-input:hover { border-color: #94a3b8; background: var(--surface); }
.recurso-link-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.recurso-link-ext {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.82rem; color: var(--accent);
  padding: 0.3rem 0.25rem; word-break: break-all;
}

/* ── Publicación tab ─────────────────────────────────── */
.pub-textarea {
  width: 100%; min-height: 72px;
  font-size: 0.875rem; font-family: inherit; line-height: 1.6;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  resize: none; overflow: hidden;
  transition: border-color .15s, background .15s;
}
.pub-textarea:hover { border-color: #94a3b8; background: var(--surface); }
.pub-textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.pub-textarea::placeholder { color: #CBD5E1; font-style: italic; }
.pub-textarea-lg { min-height: 140px; }

.pub-archivos-panel { margin-top: 0.35rem; }
.pub-archivos-list { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.5rem; }
.pub-archivo-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.pub-archivo-link {
  display: flex; align-items: center; gap: 0.4rem;
  flex: 1; font-size: 0.82rem; color: var(--accent);
  text-decoration: none; word-break: break-all;
}
.pub-archivo-link:hover { text-decoration: underline; }
.pub-archivo-size { color: var(--text-muted); font-size: 0.75rem; margin-left: 0.25rem; }
.pub-upload-form {
  display: flex; align-items: center; gap: 0.5rem;
  margin-top: 0.25rem; flex-wrap: wrap;
}
.pub-upload-input { font-size: 0.8rem; flex: 1; min-width: 0; }

/* ── Seguimiento de Invitados por Episodio ───────────── */
.seg-list { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.25rem 0; }

.seg-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.seg-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 0.875rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
}
.seg-card-name {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  font-weight: 600; font-size: 0.925rem;
}
.seg-inv-link { color: var(--text); text-decoration: none; }
.seg-inv-link:hover { color: var(--accent); }

.seg-card-right {
  display: flex; align-items: center; gap: 0.625rem; flex-shrink: 0;
}
.seg-progreso-wrap {
  width: 56px; height: 5px; background: var(--border);
  border-radius: 3px; overflow: hidden;
}
.seg-progreso-bar { height: 100%; background: var(--success); border-radius: 3px; transition: width .3s; }

.seg-toggle-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 0.15rem; display: flex; align-items: center;
}
.seg-toggle-btn i { transition: transform .2s; }

.seg-body { padding: 0.75rem 0.875rem; display: flex; flex-direction: column; gap: 0; }

.seg-section {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--bg);
}
.seg-section:last-child { border-bottom: none; }

.seg-section-title {
  font-size: 0.72rem; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.seg-check-row {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.375rem;
}
.seg-check-row:last-child { margin-bottom: 0; }

.seg-bool-btn {
  flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 0; display: flex; align-items: center;
  font-size: 1.15rem; transition: color .15s;
}
.seg-bool-btn.active { color: var(--success); }
.seg-bool-btn.static { cursor: default; }
.seg-bool-btn:not(.static):hover { color: var(--accent); }

.seg-check-label { font-size: 0.875rem; color: var(--text); }

.seg-sub-fields {
  margin: 0.4rem 0 0.4rem 1.65rem;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.seg-field-row { display: flex; align-items: center; gap: 0.5rem; }
.seg-label { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; min-width: 100px; }

.seg-input {
  font-size: 0.85rem; padding: 0.3rem 0.5rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  width: 100%; max-width: 320px;
}
.seg-input:focus { outline: none; border-color: var(--accent); }

.seg-textarea {
  width: 100%; font-size: 0.875rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  resize: vertical; min-height: 2.5rem;
  font-family: inherit;
}
.seg-textarea:focus { outline: none; border-color: var(--accent); }
.seg-notas-inline { margin-top: 0.5rem; min-height: 2rem; font-size: 0.82rem; }

.seg-text-ro {
  font-size: 0.875rem; color: var(--text);
  background: var(--surface-2); padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}

/* Notas inline en checklist items */
.check-main { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; min-width: 0; }

.check-label-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.check-responsable-wrap { margin-left: auto; flex-shrink: 0; }
.check-responsable-select {
  font-size: 0.75rem; font-family: inherit;
  padding: 0.15rem 0.4rem;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted);
  cursor: pointer; max-width: 130px;
  transition: border-color .15s, background .15s;
}
.check-responsable-select:hover { border-color: var(--border); background: var(--surface-2); }
.check-responsable-select:focus { outline: none; border-color: var(--accent); background: var(--surface); color: var(--text); }
.check-responsable-badge {
  font-size: 0.7rem; background: var(--surface-2); color: var(--text-muted);
  padding: 0.1rem 0.45rem; border-radius: 20px;
  border: 1px solid var(--border); flex-shrink: 0; margin-left: auto;
}

.check-notas-wrap { margin-top: 0.2rem; }
.check-notas-input {
  width: 100%; font-size: 0.8rem; font-family: inherit;
  padding: 0.25rem 0.4rem;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted);
  resize: none; overflow: hidden; min-height: 1.6rem;
  transition: border-color .15s, background .15s;
}
.check-notas-input:hover { border-color: var(--border); background: var(--surface-2); }
.check-notas-input:focus { outline: none; border-color: var(--accent); background: var(--surface); color: var(--text); }
.check-notas-input::placeholder { color: #CBD5E1; }
.check-notas-ro {
  font-size: 0.8rem; color: var(--text-muted); font-style: italic;
  padding: 0.1rem 0.25rem;
}

/* Plantillas de mensajes */
.plantilla-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; padding: 0.75rem 0;
  border-bottom: 1px solid var(--bg);
}
.plantilla-row:last-child { border-bottom: none; }
.plantilla-row-main { flex: 1; min-width: 0; }
.plantilla-nombre { font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.plantilla-preview {
  font-size: 0.8rem; color: var(--text-muted);
  margin-top: 0.2rem; white-space: pre-wrap; word-break: break-word;
}
.plantilla-row-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }
.plantilla-inactiva { opacity: 0.55; }

/* Hint en form de plantilla */
.form-hint {
  font-size: 0.78rem; color: var(--text-muted);
  margin-left: 0.5rem; font-weight: 400;
}
.form-hint code {
  background: var(--bg); padding: 0.05rem 0.3rem;
  border-radius: 3px; font-size: 0.75rem; color: var(--accent);
}
.form-check-group { display: flex; align-items: center; gap: 0.5rem; }

/* ── Sección Contenidos (episodio) ───────────────────── */
.contenidos-section { padding-top: 0.5rem; }

.contenidos-block-title {
  font-size: 0.72rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 0.4rem;
}
.consignas-count { color: var(--accent); font-weight: 700; }
.contenidos-block-title::before {
  content: '';
  display: inline-block;
  width: 3px; height: 12px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Inventario: lista de consignas */
.consignas-list {
  display: flex; flex-direction: column; gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.consigna-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  transition: border-color .15s;
}
.consigna-row:focus-within { border-color: #94a3b8; }
.consigna-evaluacion { border-left: 3px solid #CBD5E1; }
.consigna-posible    { border-left: 3px solid #F59E0B; }
.consigna-descartada { border-left: 3px solid #CBD5E1; opacity: 0.5; }
.consigna-descartada .consigna-textarea { text-decoration: line-through; color: var(--text-secondary); }

.consigna-textarea {
  width: 100%; font-size: 0.875rem; font-family: inherit; line-height: 1.5;
  padding: 0.3rem 0.25rem;
  border: none; background: transparent; color: var(--text);
  resize: none; overflow: hidden;
}
.consigna-textarea:focus { outline: none; }

.consigna-actions {
  display: flex; align-items: center; gap: 0.5rem;
  margin-top: 0.4rem; flex-wrap: wrap;
}

.consigna-autor-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.72rem; color: var(--text-muted);
  background: var(--bg); border-radius: 20px;
  padding: 0.15rem 0.5rem; border: 1px solid var(--border);
  white-space: nowrap;
}

.consigna-estado-select {
  font-size: 0.78rem; font-family: inherit;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  cursor: pointer;
}
.consigna-estado-select:focus { outline: none; border-color: var(--accent); }
.estado-evaluacion { color: #6B7280; }
.estado-posible    { color: #D97706; font-weight: 500; }
.estado-seleccionada { color: #059669; font-weight: 600; }
.estado-descartada { color: var(--accent); }

.consigna-save-btn { margin-left: auto; color: var(--success) !important; }

/* ── Reacciones a consignas ──────────────────────────── */
.consigna-reacciones {
  padding: 0.4rem 0.75rem 0.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.reaccion-btns {
  display: flex; gap: 0.35rem; align-items: center;
}
.reaccion-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.55rem; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); font-size: 0.78rem; cursor: pointer;
  transition: all .15s;
}
.reaccion-btn:hover { border-color: #94a3b8; color: var(--text); }
.reaccion-btn.activa.reaccion-suma    { background:#dcfce7; border-color:#86efac; color:#15803d; }
.reaccion-btn.activa.reaccion-reformula { background:#fef9c3; border-color:#fde047; color:#854d0e; }
.reaccion-btn.activa.reaccion-no      { background:#fee2e2; border-color:#fca5a5; color:#b91c1c; }
.reaccion-count { font-weight: 600; }
.consigna-reformulacion-input {
  width: 100%; margin-top: 0.4rem; font-size: 0.83rem; font-family: inherit;
  padding: 0.35rem 0.55rem; border: 1px solid #fde047; border-radius: var(--radius-sm);
  background: #fefce8; color: var(--text); resize: none; overflow: hidden;
}
.consigna-reformulacion-input:focus { outline: none; border-color: #d97706; }
.reformulaciones-list {
  margin-top: 0.45rem; display: flex; flex-direction: column; gap: 0.25rem;
}
.reformulacion-item {
  font-size: 0.78rem; color: var(--text-muted);
  display: flex; gap: 0.35rem; align-items: baseline;
}
.reformulacion-autor { font-weight: 600; color: var(--text); white-space: nowrap; }
.reformulacion-texto { font-style: italic; }
.btn-aceptar-reformulacion {
  display: inline-flex; align-items: center; gap: 0.2rem;
  font-size: 0.72rem; font-weight: 600; white-space: nowrap;
  padding: 0.15rem 0.45rem; border-radius: 99px;
  border: 1px solid #86efac; background: #dcfce7; color: #15803d;
  cursor: pointer; flex-shrink: 0;
  transition: background .15s;
}
.btn-aceptar-reformulacion:hover { background: #bbf7d0; }
.btn-rechazar-reformulacion {
  display: inline-flex; align-items: center; gap: 0.2rem;
  font-size: 0.72rem; font-weight: 600; white-space: nowrap;
  padding: 0.15rem 0.45rem; border-radius: 99px;
  border: 1px solid #fca5a5; background: #fee2e2; color: #b91c1c;
  cursor: pointer; flex-shrink: 0;
  transition: background .15s;
}
.btn-rechazar-reformulacion:hover { background: #fecaca; }

.consigna-add-form { margin-top: 0.25rem; }
.consigna-add-textarea {
  width: 100%; font-size: 0.875rem; font-family: inherit; line-height: 1.5;
  padding: 0.4rem 0.6rem;
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  resize: none; overflow: hidden;
  transition: border-color .15s, background .15s;
}
.consigna-add-textarea:focus {
  outline: none; border-color: var(--accent);
  border-style: solid; background: var(--surface);
}
.consigna-add-textarea::placeholder { color: #CBD5E1; font-style: italic; }

.consigna-add-meta {
  display: flex; align-items: center; gap: 0.5rem;
  margin-top: 0.4rem; flex-wrap: wrap;
}

.consignas-empty {
  font-size: 0.82rem; color: var(--text-muted);
  font-style: italic; padding: 0.35rem 0; margin-bottom: 0.5rem;
}

/* Cuestionario Final */
.cuestionario-list {
  display: flex; flex-direction: column; gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.cuestionario-row {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #ECFDF5; border: 1px solid #A7F3D0;
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.cuestionario-texto {
  flex: 1; font-size: 0.875rem; line-height: 1.55;
  color: var(--text); min-width: 200px;
  font-style: italic;
}

.cuestionario-meta {
  display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0;
}

.cuestionario-votos {
  display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0;
}
.voto-btn {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.5rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-size: 0.8rem;
  cursor: pointer; background: transparent;
  color: var(--text-secondary); transition: all 0.15s;
}
.voto-btn:hover { background: var(--surface-2); }
.voto-count { font-size: 0.75rem; font-weight: 600; }
.voto-si.activo  { background: #DCFCE7; border-color: #86EFAC; color: #15803D; }
.voto-no.activo  { background: #FEE2E2; border-color: #FCA5A5; color: #DC2626; }
.voto-si:not(.activo):hover { color: #15803D; }
.voto-no:not(.activo):hover { color: #DC2626; }

.consigna-ronda-select {
  font-size: 0.78rem; font-family: inherit;
  padding: 0.2rem 0.45rem;
  border: 1px solid #6EE7B7; border-radius: var(--radius-sm);
  background: white; color: var(--text);
  cursor: pointer;
}
.consigna-ronda-select:focus { outline: none; border-color: #059669; }

/* Tarjetas */
.tarjetas-section { padding: 0.25rem 0 0.5rem; }

.tarjetas-preview-list {
  display: flex; flex-direction: column; gap: 0.3rem;
  margin-bottom: 0.25rem;
}

.tarjeta-preview-chip {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.65rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.82rem;
}
.tarjeta-preview-chip.tarjeta-sin-ronda { border-color: #FCA5A5; background: #FFF5F5; }

.tarjeta-ronda-badge {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  color: #1A1A2E; white-space: nowrap;
  background: white; border: 1px solid #CBD5E1;
  border-radius: 4px; padding: 0.1rem 0.4rem;
  flex-shrink: 0;
}
.tarjeta-preview-chip.tarjeta-sin-ronda .tarjeta-ronda-badge {
  color: #DC2626; border-color: #FCA5A5; background: #FFF5F5;
}

.tarjeta-texto-preview {
  flex: 1; color: var(--text-muted); font-style: italic;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Instructivos y Protocolos */
.instructivos-list {
  display: flex; flex-direction: column; gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.instructivo-item {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}

.instructivo-header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.instructivo-icono { color: var(--text-muted); font-size: 1.05rem; flex-shrink: 0; }
.instructivo-nombre { font-size: 0.875rem; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.instructivo-header-actions { display: flex; gap: 0.15rem; flex-shrink: 0; margin-left: auto; }

.instructivo-preview { padding: 0.5rem 0.75rem 0.75rem; }
.instructivo-preview-img img {
  max-width: 100%; max-height: 280px;
  border-radius: var(--radius-sm); display: block;
}
.instructivo-iframe {
  width: 100%; height: 320px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  display: block;
}
.instructivo-doc-placeholder {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.5rem; text-align: center; gap: 0.4rem;
  color: var(--text-muted); font-size: 0.82rem;
}

.instructivo-upload-form {
  display: flex; align-items: center; gap: 0.5rem;
  flex-wrap: wrap; margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.instructivo-nombre-input {
  flex: 1; min-width: 150px;
}
.instructivo-file-label {
  display: inline-flex; align-items: center; gap: 0.4rem;
  cursor: pointer; font-size: 0.82rem; color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s;
  flex: 1.5; min-width: 160px; overflow: hidden;
}
.instructivo-file-label:hover { border-color: #94a3b8; }
.instructivo-file-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.instructivo-file-input { display: none; }

/* ── Tab Edición ─────────────────────────────────────── */
.edicion-seccion {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.85rem 1rem; margin-bottom: 1rem;
  background: var(--surface);
}

.edicion-sec-header {
  font-size: 0.72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.edicion-sec-header > span { flex: 1; }

.sec-responsable-select {
  font-size: 0.75rem; font-family: inherit;
  padding: 0.15rem 0.4rem;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted);
  cursor: pointer; max-width: 140px; text-transform: none; letter-spacing: 0;
  transition: border-color .15s, background .15s;
}
.sec-responsable-select:hover { border-color: var(--border); background: var(--surface-2); }
.sec-responsable-select:focus { outline: none; border-color: var(--accent); background: var(--surface); color: var(--text); }
.sec-responsable-badge {
  font-size: 0.7rem; background: var(--surface-2); color: var(--text-muted);
  padding: 0.1rem 0.45rem; border-radius: 20px;
  border: 1px solid var(--border); flex-shrink: 0;
  text-transform: none; letter-spacing: 0;
}
.seg-coordinador-select { max-width: 120px; }
.prepro-sec-responsable { display: flex; justify-content: flex-end; margin-bottom: 0.5rem; }

.edicion-campo { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.65rem; }
.edicion-campo:last-child { margin-bottom: 0; }

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

.edicion-input {
  font-size: 0.85rem; padding: 0.35rem 0.6rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); outline: none;
  transition: border-color .15s;
}
.edicion-input:focus { border-color: var(--accent); }

.edicion-link { width: 100%; }

.edicion-textarea {
  font-size: 0.85rem; padding: 0.4rem 0.6rem; min-height: 60px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); resize: none; outline: none;
  width: 100%; transition: border-color .15s; line-height: 1.4;
}
.edicion-textarea:focus { border-color: var(--accent); }

.edicion-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.65rem; }
.edicion-campo-fecha { flex: 1; min-width: 160px; }

.edicion-link-row { display: flex; align-items: center; gap: 0.5rem; }
.edicion-link-row .edicion-link { flex: 1; }

.edicion-link-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.78rem; color: var(--accent); text-decoration: none;
  white-space: nowrap; flex-shrink: 0;
}
.edicion-link-btn:hover { text-decoration: underline; }

/* Notas de edición */
.edicion-notas-panel { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.25rem; }

.edicion-notas-list { display: flex; flex-direction: column; gap: 0.4rem; }

.edicion-nota-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.6rem 0.75rem;
}
.edicion-nota-editing { border-color: var(--accent); }

.edicion-nota-meta {
  display: flex; align-items: center; gap: 0.45rem;
  margin-bottom: 0.35rem; flex-wrap: wrap;
}
.edicion-nota-autor-nombre { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.edicion-nota-fecha { font-size: 0.75rem; color: var(--text-muted); }
.edicion-nota-editado { font-size: 0.72rem; color: var(--text-muted); font-style: italic; }

.edicion-nota-btns {
  display: flex; gap: 0.2rem; margin-left: auto;
}

.edicion-nota-texto { font-size: 0.85rem; color: var(--text); line-height: 1.5; white-space: pre-wrap; }

.edicion-nota-input {
  width: 100%; font-size: 0.85rem; padding: 0.4rem 0.6rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); resize: none; outline: none;
  min-height: 52px; line-height: 1.4; transition: border-color .15s;
}
.edicion-nota-input:focus { border-color: var(--accent); }
.edicion-nota-edit-input { min-height: 70px; }

.edicion-nota-submit { margin-top: 0.3rem; }

.edicion-nota-edit-actions { display: flex; gap: 0.5rem; margin-top: 0.4rem; }

/* ── Calendario Dashboard ────────────────────────────── */
.cal-card { margin-bottom: 1.5rem; }

.cal-header { padding: 1rem 1.25rem 0.75rem; border-bottom: 1px solid var(--border); }

.cal-title-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.75rem;
}

.cal-filtros { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.cal-filtro {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.78rem; font-weight: 500; color: var(--text-muted);
  cursor: pointer; user-select: none;
}
.cal-filtro input { display: none; }
.cal-filtro-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid currentColor; transition: background 0.15s;
}
.cal-filtro.armado      { color: #F97316; }
.cal-filtro.rodaje      { color: #3B82F6; }
.cal-filtro.edicion     { color: #7C3AED; }
.cal-filtro.publicacion { color: #22C55E; }
.cal-filtro.reel        { color: #EC4899; }
.cal-filtro input:checked + .cal-filtro-dot { background: currentColor; }
.cal-filtro input:not(:checked) ~ * { opacity: 0.45; }

.cal-nav {
  display: flex; align-items: center; gap: 0.5rem;
}
.cal-nav-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.2rem 0.45rem; cursor: pointer; color: var(--text-muted);
  font-size: 0.9rem; transition: background 0.15s, color 0.15s;
}
.cal-nav-btn:hover { background: var(--surface); color: var(--text); }
.cal-nav-titulo {
  font-size: 0.95rem; font-weight: 600; color: var(--text);
  min-width: 160px; text-align: center;
}

.cal-grid-wrap { padding: 0.75rem 1rem; }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-dow {
  text-align: center; font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-muted); padding: 0.25rem 0 0.4rem;
}

.cal-day {
  min-height: 54px; border-radius: 6px; padding: 0.3rem 0.35rem 0.25rem;
  overflow: hidden; min-width: 0;
  cursor: pointer; transition: background 0.1s;
  border: 1px solid transparent; position: relative;
  display: flex; flex-direction: column; align-items: flex-start;
}
.cal-day:hover { background: var(--surface); }
.cal-day-empty { cursor: default; }
.cal-day-hoy { border-color: var(--accent); }
.cal-day-hoy .cal-day-num { color: var(--accent); font-weight: 700; }
.cal-day-selec { background: var(--surface); border-color: var(--primary); }
.cal-day-con-eventos { background: var(--bg); }

.cal-day-num {
  font-size: 0.78rem; font-weight: 500; color: var(--text);
  line-height: 1; margin-bottom: 0.3rem;
}

.cal-chip {
  display: block; width: 100%; min-width: 0;
  font-size: 0.62rem; font-weight: 600; line-height: 1.3;
  padding: 0.15rem 0.3rem; border-radius: 4px;
  border: 1px solid; margin-bottom: 2px;
  overflow: hidden;
}
.cal-chip-ep {
  display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 700;
}
.cal-chip-tipo {
  display: block;
  font-size: 0.58rem; font-weight: 500; opacity: 0.82;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cal-detail { border-top: 1px solid var(--border); }

.cal-detail-inner { padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.4rem; }

.cal-detail-fecha {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.2rem;
}

.cal-ev-group { margin-bottom: 0.35rem; }
.cal-ev-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.45rem 0.7rem; border-radius: var(--radius) var(--radius) 0 0;
  text-decoration: none; transition: opacity 0.15s;
  border-left-width: 3px; border-left-style: solid;
}
.cal-ev-group:not(:has(.cal-ev-extras)) .cal-ev-row { border-radius: var(--radius); }
.cal-ev-row:hover { opacity: 0.85; }
.cal-ev-tipo {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; white-space: nowrap; min-width: 70px;
}
.cal-ev-label { font-size: 0.82rem; color: var(--text); flex: 1; }
.cal-ev-hora  { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.cal-ev-arrow { font-size: 0.8rem; color: var(--text-muted); margin-left: auto; }

.cal-ev-extras {
  padding: 0.4rem 0.7rem 0.5rem;
  border-left-width: 3px; border-left-style: solid;
  border-radius: 0 0 var(--radius) var(--radius);
}
.cal-ev-extra-item {
  display: flex; gap: 0.4rem; align-items: flex-start;
  font-size: 0.78rem; padding: 0.15rem 0;
  border-top: 1px solid rgba(0,0,0,0.05);
}
.cal-ev-extra-lbl {
  font-weight: 600; color: var(--text-muted); white-space: nowrap; min-width: 60px;
}
.cal-ev-extra-link {
  color: var(--info); text-decoration: none; word-break: break-all;
}
.cal-ev-extra-link:hover { text-decoration: underline; }
.cal-ev-extra-txt {
  color: var(--text); white-space: pre-line; word-break: break-word;
}

/* ── Auspiciantes ────────────────────────────────────── */
.ausp-section-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
}
.ausp-section-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.15rem; }
.ausp-section-sub { font-size: 0.82rem; color: var(--text-muted); margin: 0; }

.material-list { display: flex; flex-direction: column; gap: 0; }
.material-item {
  display: flex; align-items: flex-start; gap: 0.9rem;
  padding: 0.9rem 1rem; border: 1px solid var(--border);
  border-bottom: none; background: var(--card-bg);
}
.material-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.material-item:last-child { border-bottom: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.material-item:only-child { border-radius: var(--radius); border-bottom: 1px solid var(--border); }
.material-item-icon {
  font-size: 1.3rem; color: var(--text-muted);
  padding-top: 0.1rem; flex-shrink: 0;
}
.material-item-body { flex: 1; min-width: 0; }
.material-item-titulo { font-weight: 600; font-size: 0.95rem; }
.material-item-ref { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.1rem; }
.material-item-notas { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.25rem; line-height: 1.4; }
.material-item-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.35rem; }
.material-item-actions {
  display: flex; align-items: center; gap: 0.2rem; flex-shrink: 0;
}
.material-archivo-actual {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface-2); border-radius: 6px;
  padding: 0.4rem 0.75rem; font-size: 0.82rem; margin-bottom: 0.35rem;
}

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

.ausp-card {
  display: flex; flex-direction: column; gap: 0.5rem;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem;
  text-decoration: none; color: var(--text);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.ausp-card:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  border-color: var(--primary);
}

.ausp-card-top {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.ausp-card-nombre {
  font-size: 1rem; font-weight: 700; color: var(--text);
}
.ausp-card-rubros { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.ausp-card-desc { font-size: 0.82rem; color: var(--text-muted); margin: 0; line-height: 1.4; }
.ausp-card-footer {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  font-size: 0.78rem; color: var(--text-muted);
  border-top: 1px solid var(--border); padding-top: 0.5rem; margin-top: auto;
}
.ausp-card-footer span { display: flex; align-items: center; gap: 0.25rem; }

.ausp-detail-header { padding: 1.25rem 1.5rem; }
.ausp-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 700px) { .ausp-detail-grid { grid-template-columns: 1fr; } }

.ausp-section .ausp-section-body { padding: 0 1.25rem 1.25rem; }
.ausp-field-row {
  display: flex; gap: 0.75rem; padding: 0.55rem 0;
  border-bottom: 1px solid var(--border); font-size: 0.88rem;
}
.ausp-field-row:last-child { border-bottom: none; }
.ausp-field-lbl {
  flex: 0 0 130px; font-weight: 600; color: var(--text-muted); font-size: 0.8rem;
}
.ausp-field-val { flex: 1; color: var(--text); line-height: 1.5; }

.ausp-form .form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.ausp-form .form-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.ausp-form .form-input,
.ausp-form .form-textarea {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.5rem 0.75rem; font-size: 0.9rem; font-family: inherit;
  background: var(--bg); color: var(--text); width: 100%;
  transition: border-color 0.15s;
}
.ausp-form .form-input:focus,
.ausp-form .form-textarea:focus { outline: none; border-color: var(--primary); }
.ausp-form .form-textarea { resize: vertical; min-height: 80px; }

.tag-sug-btn {
  font-size: 0.75rem; padding: 0.2rem 0.6rem; border-radius: 20px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-muted);
  cursor: pointer; transition: all 0.15s;
}
.tag-sug-btn:hover { border-color: var(--primary); color: var(--primary); }
.tag-sug-btn.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
}

.premio-row {
  display: flex; align-items: center; gap: 0.5rem;
}

.ausp-premios-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.ausp-premios-table th {
  text-align: left; font-size: 0.75rem; font-weight: 700;
  color: var(--text-muted); padding: 0.25rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.ausp-premios-table td {
  padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--border);
  color: var(--text);
}
.ausp-premios-table tr:last-child td { border-bottom: none; }

/* ── Premios/Regalos Invitados ───────────────────────── */
.premios-header {
  display: flex; align-items: center; gap: 0.55rem;
}
.premios-header .check-btn.static { cursor: default; }
.premio-empresa-tag {
  display: inline-block;
  font-size: 0.72rem; font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 4px;
  padding: 0.08rem 0.45rem;
  margin-right: 0.25rem;
  white-space: nowrap;
}

/* ── Prensa y Difusión ───────────────────────────────── */
.prensa-plantilla-ta {
  width: 100%; min-height: 180px; resize: vertical;
  font-family: inherit; font-size: 0.88rem; line-height: 1.6;
}
.prensa-plantilla-ro {
  font-size: 0.88rem; line-height: 1.7; color: var(--text);
  white-space: pre-wrap;
}
.mailing-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.mailing-table th {
  text-align: left; font-size: 0.73rem; font-weight: 700;
  color: var(--text-muted); padding: 0.5rem 0.8rem;
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.mailing-table td {
  padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--border);
  color: var(--text);
}
.mailing-table tr:last-child td { border-bottom: none; }
.mailing-table tr.mailing-inactivo td { opacity: 0.45; }
.mailing-table tr:hover td { background: var(--bg-alt); }

/* ── Rodaje Tab ──────────────────────────────────────── */
.rodaje-tab { display: flex; flex-direction: column; gap: 1.25rem; }

.rodaje-sec-header {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 0 0 0.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.rodaje-seccion { }

.rodaje-productora-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.85rem 1rem;
}

.rodaje-productora-form { display: flex; flex-direction: column; gap: 0.6rem; }

.rodaje-productora-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

.rodaje-prod-label {
  font-size: 0.82rem; color: var(--text-muted); min-width: 160px; flex-shrink: 0;
}

.rodaje-prod-inputs { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.rodaje-prod-input {
  font-size: 0.82rem; padding: 0.3rem 0.5rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text);
}
.rodaje-prod-input:focus { outline: none; border-color: var(--accent); }

.time-clear-btn {
  background: none; border: none; padding: 0.1rem 0.25rem;
  color: var(--text-muted); cursor: pointer; border-radius: 3px;
  font-size: 0.75rem; line-height: 1; flex-shrink: 0;
  transition: color 0.15s;
}
.time-clear-btn:hover { color: var(--accent); }

.rodaje-prod-fecha-display {
  font-size: 0.82rem; color: var(--text); padding: 0.3rem 0.5rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.rodaje-prod-fecha-display.muted { color: var(--text-muted); }

.rodaje-check-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.1rem;
}

.rodaje-check-item {
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.rodaje-check-item:hover { background: var(--surface); }
.rodaje-check-item.done .item-label { text-decoration: line-through; color: var(--text-muted); }

.rodaje-check-row { display: flex; align-items: flex-start; gap: 0.5rem; }

.rodaje-check-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }

.rodaje-proto-wrap { position: relative; margin: 0.3rem 0 0.1rem; }

.rodaje-proto-input {
  width: 100%; box-sizing: border-box;
  font-size: 0.82rem; line-height: 1.45;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  resize: none; transition: border-color 0.15s;
  font-family: inherit;
}
.rodaje-proto-input:focus { outline: none; border-color: var(--accent); }
.rodaje-proto-input::placeholder { color: var(--text-muted); font-style: italic; }
.rodaje-proto-input.customizado { border-color: #3b82f6; }

.rodaje-proto-badge {
  display: inline-block; font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: #3b82f6; margin-top: 0.2rem;
}
.rodaje-proto-badge.muted { color: var(--text-muted); }

.rodaje-proto-ro {
  font-size: 0.82rem; line-height: 1.45; color: var(--text);
  padding: 0.35rem 0.5rem;
  border-left: 2px solid var(--border); margin: 0.2rem 0;
}
.rodaje-proto-ro.muted { color: var(--text-muted); font-style: italic; }

.rodaje-ref-archivos { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.25rem; }

.rodaje-archivo-wrap { display: flex; flex-direction: column; gap: 0; }

.rodaje-archivo-panel {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-top: 0.25rem;
  background: var(--bg);
}

.rodaje-archivo-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0.6rem;
  background: var(--surface); border-bottom: 1px solid var(--border);
}

.rodaje-archivo-panel-nombre {
  font-size: 0.78rem; font-weight: 500; color: var(--text);
  display: flex; align-items: center; gap: 0.35rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.rodaje-archivo-panel-actions { display: flex; gap: 0.2rem; flex-shrink: 0; margin-left: 0.5rem; }

.rodaje-archivo-content { padding: 0.5rem; }

.rodaje-archivo-img { max-width: 100%; max-height: 300px; border-radius: 4px; display: block; }

.rodaje-archivo-iframe { width: 100%; height: 360px; border: none; display: block; }

.rodaje-archivo-nodisponible {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1.5rem; color: var(--text-muted); font-size: 0.82rem; text-align: center;
}
.rodaje-archivo-nodisponible i { font-size: 2rem; }

.rodaje-docx-loading { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--text-muted); padding: 0.5rem; }

.rodaje-docx-rendered {
  font-size: 0.85rem; line-height: 1.55; color: var(--text);
  max-height: 360px; overflow-y: auto; padding: 0.25rem 0.25rem;
}
.rodaje-docx-rendered p { margin: 0.3em 0; }
.rodaje-docx-rendered h1, .rodaje-docx-rendered h2, .rodaje-docx-rendered h3 { margin: 0.5em 0 0.2em; font-size: 1em; font-weight: 700; }
.rodaje-docx-rendered ul, .rodaje-docx-rendered ol { padding-left: 1.2em; margin: 0.3em 0; }
.rodaje-docx-rendered table { border-collapse: collapse; width: 100%; font-size: 0.8rem; }
.rodaje-docx-rendered td, .rodaje-docx-rendered th { border: 1px solid var(--border); padding: 0.2rem 0.4rem; }

.rodaje-ref-archivo {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.75rem; color: var(--text-muted);
  text-decoration: none; border: 1px solid var(--border);
  border-radius: 4px; padding: 0.1rem 0.4rem;
  background: var(--bg);
  transition: border-color 0.15s, color 0.15s;
}
.rodaje-ref-archivo:hover { border-color: var(--accent); color: var(--accent); }

/* ── Promoción/Recortes ──────────────────────────────── */
.promo-reel-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.promo-reel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.promo-reel-titulo {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Promo YouTube ───────────────────────────────────── */
.promo-yt-titulo {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  padding: 0.3rem 0;
}

/* ── Sidebar overlay (mobile) ───────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
  cursor: pointer;
}
.sidebar-overlay.active { display: block; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1100px) {
  .episode-layout { grid-template-columns: 1fr; }
  .episode-comments { position: static; }
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
  .ep-sections-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .metrics-grid-3 { grid-template-columns: 1fr 1fr; } /* 2 cols en tablet */
  .dashboard-grid { grid-template-columns: 1fr; }
  .ep-sections-grid { grid-template-columns: 1fr; }
  .activity-grid { grid-template-columns: 1fr; }
  .archivo-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .kanban-board { grid-template-columns: 1fr 1fr; }
  .episodes-table th:nth-child(5), .episodes-table td:nth-child(5),
  .episodes-table th:nth-child(6), .episodes-table td:nth-child(6) { display: none; }
}
@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-value { font-size: 1.3rem; }
  .kanban-board { grid-template-columns: 1fr; }
  .main-content { padding: 1rem; }
}

/* ── Responsive extras ───────────────────────────────── */
@media (max-width: 768px) {
  .topbar { padding: 0 0.75rem; gap: 0.5rem; }
  .episode-tabs {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; flex-wrap: nowrap;
  }
  .episode-tabs::-webkit-scrollbar { display: none; }
  .ep-tab { white-space: nowrap; flex-shrink: 0; }
  .episodes-table-wrap { overflow-x: auto; }
  .mailing-table { display: block; overflow-x: auto; }
  .cal-day { min-height: 42px; padding: 0.2rem 0.15rem; }
  .cal-chip { font-size: 0.55rem; padding: 0.1rem 0.2rem; }
  .cal-chip-tipo { display: none; }
  .cal-grid-wrap { padding: 0.5rem 0.4rem; }
  .cal-nav-titulo { min-width: 120px; font-size: 0.85rem; }
  .rodaje-prod-label { min-width: auto; }
  .seg-row { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .topbar { padding: 0 0.5rem; }
  .episodes-table th:nth-child(3), .episodes-table td:nth-child(3) { display: none; }
  .cal-day { min-height: 34px; }
  .episode-tema { font-size: 1.2rem; }
  .seg-row-check-label { display: none; }
  .taller-row { flex-direction: column; }
}

/* ── Taller ──────────────────────────────────────────── */
.taller-list {
  display: flex; flex-direction: column; gap: 0.6rem;
}

.tarea-card {
  display: block; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.875rem 1rem; text-decoration: none; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow);
}
.tarea-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }

.tarea-card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 0.3rem;
}
.tarea-card-titulo {
  font-weight: 600; font-size: 0.95rem; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tarea-card-ref {
  font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.4rem;
  display: flex; align-items: center; gap: 0.25rem;
}
.tarea-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0.5rem; padding-top: 0.4rem; border-top: 1px solid var(--bg);
  font-size: 0.78rem; color: var(--text-muted);
}
.tarea-card-author { display: flex; align-items: center; gap: 0.4rem; }
.tarea-card-meta { display: flex; align-items: center; gap: 0.6rem; }
.tarea-card-meta span { display: flex; align-items: center; gap: 0.2rem; }

/* Estado badges */
.tarea-estado-badge {
  display: inline-block; font-size: 0.7rem; font-weight: 600;
  padding: 0.15rem 0.55rem; border-radius: 20px; white-space: nowrap; flex-shrink: 0;
}
.tarea-estado-abierta     { background: #EFF6FF; color: #2563EB; }
.tarea-estado-en_progreso { background: #FFF7ED; color: #D97706; }
.tarea-estado-lista       { background: #ECFDF5; color: #059669; }
.tarea-estado-archivada   { background: #F1F5F9; color: #64748B; }

/* Estado select en topbar */
.taller-estado-select {
  font-size: 0.8rem; font-family: inherit; font-weight: 600;
  padding: 0.3rem 0.6rem; border-radius: 20px; cursor: pointer;
  border: 1px solid; outline: none; transition: opacity .15s;
}
.taller-estado-abierta     { background: #EFF6FF; color: #2563EB; border-color: #BFDBFE; }
.taller-estado-en_progreso { background: #FFF7ED; color: #D97706; border-color: #FCD34D; }
.taller-estado-lista       { background: #ECFDF5; color: #059669; border-color: #6EE7B7; }
.taller-estado-archivada   { background: #F1F5F9; color: #64748B; border-color: #CBD5E1; }

/* Detail page */
.taller-tarea-meta {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem; color: var(--text-muted); flex-wrap: wrap;
}
.taller-meta-sep { color: var(--border); }

.taller-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.875rem 1rem;
  margin-bottom: 0.75rem;
}
.taller-row {
  display: flex; gap: 0.75rem; margin-bottom: 0.75rem;
}
.taller-section-half { flex: 1; min-width: 0; margin-bottom: 0; }

.taller-field-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
  margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.3rem;
}

.taller-titulo-input {
  width: 100%; font-size: 1.1rem; font-weight: 600; font-family: inherit;
  border: none; outline: none; background: transparent; color: var(--text);
  resize: none; overflow: hidden; line-height: 1.35; padding: 0;
}
.taller-titulo-input:focus { color: var(--primary); }

.taller-input {
  width: 100%; font-size: 0.875rem; font-family: inherit;
  padding: 0.4rem 0.6rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
  transition: border-color .15s;
}
.taller-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }

.taller-notas-input {
  width: 100%; font-size: 0.875rem; font-family: inherit; line-height: 1.6;
  padding: 0.4rem 0.6rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
  resize: vertical; min-height: 80px; transition: border-color .15s;
}
.taller-notas-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.taller-notas-input::placeholder { color: #CBD5E1; font-style: italic; }

/* WhatsApp section */
.taller-wapp-section { border-color: #BBF7D0; }
.btn-wapp {
  background: #25D366; color: white; border: none;
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-weight: 500;
}
.btn-wapp:hover { filter: brightness(1.08); }
.taller-wapp-hint {
  font-size: 0.75rem; color: var(--text-muted); font-style: italic;
}

/* Archivos */
.taller-archivos-list { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.6rem; }
.taller-archivo-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.5rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2);
  font-size: 0.85rem;
}
.taller-archivo-icon { color: var(--text-muted); flex-shrink: 0; }
.taller-archivo-link { flex: 1; color: var(--accent); word-break: break-all; }
.taller-archivo-link:hover { text-decoration: underline; }
.taller-archivo-meta { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }
.taller-upload-row {
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
  padding: 0.4rem 0.5rem; background: var(--bg);
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
}
.taller-file-input { font-size: 0.8rem; flex: 1; min-width: 0; }
.taller-upload-nombre {
  font-size: 0.82rem; font-family: inherit; padding: 0.3rem 0.5rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); width: 150px;
}
.taller-upload-nombre:focus { outline: none; border-color: var(--accent); }

/* Comentarios */
.taller-comentarios-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 0.75rem; }
.taller-comentario {
  padding: 0.6rem 0; border-bottom: 1px solid var(--bg);
}
.taller-comentario:last-child { border-bottom: none; }
.taller-comentario-header {
  display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.3rem;
}
.taller-comentario-autor { font-weight: 600; font-size: 0.82rem; }
.taller-comentario-time { font-size: 0.72rem; color: var(--text-muted); flex: 1; }
.taller-comentario-del { margin-left: auto; opacity: 0; transition: opacity .15s; }
.taller-comentario:hover .taller-comentario-del { opacity: 1; }
.taller-comentario-texto { font-size: 0.875rem; line-height: 1.55; margin-left: 1.65rem; }
.taller-comentario-input {
  width: 100%; font-size: 0.875rem; font-family: inherit;
  padding: 0.45rem 0.6rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); resize: none; background: var(--surface);
  transition: border-color .15s;
}
.taller-comentario-input:focus { outline: none; border-color: var(--accent); }
.taller-empty-hint { font-size: 0.82rem; color: var(--text-muted); font-style: italic; margin-bottom: 0.6rem; }

/* ── Home de Invitados ───────────────────────────────── */
.inv-home-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.25rem; max-width: 860px;
}
@media (max-width: 640px) { .inv-home-grid { grid-template-columns: 1fr; } }

.inv-home-box {
  display: flex; align-items: center; gap: 1.25rem;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 1.25rem;
  text-decoration: none; color: var(--text);
  transition: box-shadow .15s, border-color .15s, transform .12s;
  box-shadow: var(--shadow);
}
.inv-home-box:hover {
  border-color: var(--accent); box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.inv-home-icon {
  font-size: 2rem; color: var(--accent); flex-shrink: 0;
  width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: var(--radius);
}
.inv-home-body { flex: 1; min-width: 0; }
.inv-home-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.2rem; }
.inv-home-desc { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.inv-home-stats { display: flex; gap: 1rem; flex-wrap: wrap; }
.inv-home-stat { display: flex; flex-direction: column; align-items: flex-start; }
.inv-home-stat-num { font-size: 1.25rem; font-weight: 700; color: var(--text); line-height: 1; }
.inv-home-stat-label { font-size: 0.72rem; color: var(--text-muted); text-transform: capitalize; margin-top: 0.1rem; }
.inv-home-arrow { color: var(--text-muted); font-size: 1.1rem; flex-shrink: 0; }
.inv-home-box:hover .inv-home-arrow { color: var(--accent); }

/* ── Ficha de Invitado (detail) ──────────────────────── */
.inv-ficha-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.inv-ficha-nombre { font-size: 1.5rem; font-weight: 700; margin: 0; }
.inv-ficha-apodo { font-size: 1rem; color: var(--text-muted); margin-top: 0.2rem; font-style: italic; }
.inv-ficha-badges { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; flex-shrink: 0; padding-top: 0.25rem; }
.inv-ficha-sexo {
  font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.6rem;
  border-radius: 20px; background: var(--bg); border: 1px solid var(--border);
  color: var(--text-muted);
}
.inv-ficha-section { margin-bottom: 1.25rem; }
.inv-ficha-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); margin-bottom: 0.4rem;
  display: flex; align-items: center; gap: 0.35rem;
}
.inv-ficha-text { font-size: 0.925rem; line-height: 1.6; color: var(--text); }
.inv-ficha-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem 1.25rem; margin-bottom: 1.25rem;
}

/* ── Página Mesas Sugeridas (index) ─────────────────── */
.nueva-mesa-panel {
  display: none; padding: 1.25rem 1.5rem; margin-bottom: 1rem;
}
.nueva-mesa-panel.open { display: block; }
.nueva-mesa-titulo {
  font-size: 1rem; font-weight: 600; margin: 0 0 1rem;
  display: flex; align-items: center; gap: 0.4rem; color: var(--text);
}
.nueva-mesa-form { display: flex; flex-direction: column; gap: 0.75rem; }

.mesas-inv-select-wrap {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.mesas-inv-filter {
  width: 100%; padding: 0.45rem 0.75rem;
  border: none; border-bottom: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 0.875rem;
  outline: none;
}
.mesas-inv-filter:focus { background: var(--bg); }
.mesas-inv-list {
  max-height: 200px; overflow-y: auto;
  display: flex; flex-direction: column;
}
.mesas-inv-option {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.4rem 0.75rem; cursor: pointer;
  transition: background .12s;
  font-size: 0.875rem; color: var(--text);
}
.mesas-inv-option:hover { background: var(--surface); }
.mesas-inv-option input[type=checkbox] { flex-shrink: 0; accent-color: var(--accent); }
.mesas-inv-option span:first-of-type { flex: 1; }
.mesas-inv-tag { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

.mesas-table {
  width: 100%; border-collapse: collapse; font-size: 0.875rem;
}
.mesas-table th {
  text-align: left; font-size: 0.73rem; font-weight: 700;
  color: var(--text-muted); padding: 0.6rem 1rem;
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.mesas-table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.mesas-table tr:last-child td { border-bottom: none; }
.mesas-table-row:hover td { background: var(--bg-alt); }
.mesas-table-tema { font-weight: 600; color: var(--text); min-width: 180px; }
.mesas-table-comps { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.mesa-part-chip {
  display: inline-block; padding: 0.15rem 0.55rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; font-size: 0.78rem; color: var(--text);
  text-decoration: none; transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.mesa-part-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ── Mesas de otros invitados (companion) ────────────── */
.mesa-card-companion {
  background: var(--bg); border-color: var(--border);
  opacity: 0.85;
}
.mesa-comp-origin {
  font-size: 0.72rem; color: var(--text-muted); font-style: italic;
  margin-left: auto; white-space: nowrap;
}
.mesas-companion-section {
  margin-top: 0.75rem; padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
}
.mesas-companion-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.kanban-mesa-row-companion { opacity: 0.75; }
/* ── Mesa detail ─────────────────────────────────────── */
.mesa-detail-rename-form {
  display: flex; align-items: center; gap: 0.6rem;
}
.mesa-detail-tema-input {
  flex: 1; font-size: 1.2rem; font-weight: 700;
  border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--text); padding: 0.25rem 0.4rem;
  font-family: inherit; transition: border-color .15s, background .15s;
}
.mesa-detail-tema-input:focus {
  outline: none; border-color: var(--accent); background: var(--surface);
}
.mesa-detail-tema-ro { font-size: 1.2rem; font-weight: 700; margin: 0; }
.mesa-detail-parts { display: flex; flex-direction: column; gap: 0; margin-bottom: 0.75rem; }
.mesa-detail-part-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0; border-bottom: 1px solid var(--bg);
}
.mesa-detail-part-row:last-child { border-bottom: none; }
.mesa-detail-part-name {
  flex: 1; font-size: 0.925rem; font-weight: 500; color: var(--text);
  text-decoration: none; transition: color .15s;
}
.mesa-detail-part-name:hover { color: var(--accent); }
.mesa-detail-part-badge {
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 0.1rem 0.45rem;
}
.mesa-detail-add-form {
  display: flex; align-items: center; gap: 0.5rem;
  padding-top: 0.6rem; border-top: 1px dashed var(--border); margin-top: 0.25rem;
}
/* ── Mesas index: sort & link ────────────────────────── */
.mesas-th-sortable { white-space: nowrap; }
.mesas-sort-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  color: var(--text-muted); text-decoration: none; font-size: 0.73rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  transition: color .15s;
}
.mesas-sort-link:hover { color: var(--text); }
.mesas-table-tema-link {
  color: var(--text); text-decoration: none; font-weight: 600;
  transition: color .15s;
}
.mesas-table-tema-link:hover { color: var(--accent); text-decoration: underline; }

.mesa-join-form {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.mesa-select-wide { flex: 1; min-width: 0; max-width: 100%; }

/* ── Mesas sugeridas en kanban cards ─────────────────── */
.kanban-card-mesas {
  margin: 0.3rem 0 0.1rem;
  display: flex; flex-direction: column; gap: 0.2rem;
}
.kanban-mesa-row {
  display: flex; align-items: baseline; gap: 0.35rem;
  font-size: 0.72rem; color: var(--text-muted); line-height: 1.35;
}
.kanban-mesa-row > i {
  font-size: 0.7rem; flex-shrink: 0; margin-top: 0.05rem; opacity: 0.6;
}
.kanban-mesa-tema {
  font-weight: 600; color: var(--text); margin-right: 0.1rem;
}
.kanban-mesa-comps {
  color: var(--text-muted); font-size: 0.68rem;
}

/* ── Dashboard: Novedades del equipo ─────────────────── */
.novedades-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  margin-bottom: 1rem;
}
.novedades-aside {
  display: flex; flex-direction: column; gap: 1rem;
}
.novedades-feed-card .activity-list {
  max-height: 420px;
  overflow-y: auto;
}

/* Feed badges por tipo de actividad */
.feed-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.68rem; padding: 1px 6px; border-radius: 10px;
  font-weight: 500; margin-left: 4px; vertical-align: middle;
}
.feed-badge-check_completado { background: #EAF3DE; color: #27500A; }
.feed-badge-check_revertido  { background: #FDE8E8; color: #8B1C1C; }
.feed-badge-asignacion       { background: #EEEDFE; color: #3C3489; }
.feed-badge-comentario       { background: #E6F1FB; color: #0C447C; }
.feed-badge-archivo          { background: #FAEEDA; color: #633806; }
.feed-badge-invitado         { background: #F4C0D1; color: #72243E; }
.feed-badge-estado           { background: #F1F5F9; color: #334155; }

/* Vencimientos */
.venc-list { padding: 0 0.25rem; }
.venc-item-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 0.5px solid var(--border);
  text-decoration: none; color: var(--text);
  transition: background .1s;
}
.venc-item-row:last-child { border-bottom: none; }
.venc-item-row:hover { background: var(--surface); }
.venc-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.venc-hoy     { background: #E24B4A; }
.venc-manana  { background: #EF9F27; }
.venc-pronto  { background: #639922; }
.venc-body    { flex: 1; min-width: 0; }
.venc-label   { font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.venc-fecha   { font-size: 0.72rem; font-weight: 600; padding: 1px 7px; border-radius: 20px; flex-shrink: 0; }
.badge-venc-hoy   { background: #FCEBEB; color: #A32D2D; }
.badge-venc-pronto { background: #EAF3DE; color: #27500A; }

/* Para vos */
.para-vos-list { padding: 0 0.25rem; }
.para-vos-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 0.5px solid var(--border);
  text-decoration: none; color: var(--text);
  transition: background .1s;
}
.para-vos-row:last-child { border-bottom: none; }
.para-vos-row:hover { background: var(--surface); }
.para-vos-ep {
  font-size: 0.72rem; color: var(--text-muted);
  min-width: 44px; flex-shrink: 0;
}
.para-vos-label { font-size: 0.8rem; flex: 1; min-width: 0; }

@media (max-width: 900px) {
  .novedades-grid { grid-template-columns: 1fr; }
}

/* ── Feed: botón config y panel ──────────────────────── */
.feed-config-btn {
  color: var(--text-muted);
  padding: 0.2rem 0.4rem;
}
.feed-config-btn:hover { color: var(--text); }

.feed-config-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--surface);
  margin: 0 0 0.75rem;
  overflow: hidden;
}
.feed-config-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.875rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.feed-config-title {
  font-size: 0.8rem; font-weight: 600;
  display: flex; align-items: center; gap: 0.4rem;
  color: var(--text);
}
.feed-config-close { color: var(--text-muted); }

.feed-config-grupo { padding: 0.5rem 0; }
.feed-config-nivel-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 0.2rem 0.875rem 0.35rem;
  color: var(--text-muted);
}
.nivel-alto  .feed-config-nivel-label, .feed-config-grupo:has(.nivel-alto) .feed-config-nivel-label  { color: #27500A; }
.nivel-medio .feed-config-nivel-label, .feed-config-grupo:has(.nivel-medio) .feed-config-nivel-label { color: #0C447C; }

.feed-config-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.45rem 0.875rem;
  transition: background .1s;
}
.feed-config-row:hover { background: var(--bg); }
.feed-config-info { flex: 1; min-width: 0; }
.feed-config-label {
  font-size: 0.82rem; font-weight: 500; color: var(--text);
}
.feed-config-desc {
  font-size: 0.74rem; color: var(--text-muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feed-config-row.activo .feed-config-label { color: var(--text); }
.feed-config-row:not(.activo) .feed-config-label { color: var(--text-muted); }

/* Toggle switch */
.feed-config-toggle {
  background: none; border: none; cursor: pointer; padding: 2px; flex-shrink: 0;
}
.toggle-track {
  display: block; width: 34px; height: 18px; border-radius: 9px;
  background: var(--border); position: relative; transition: background .2s;
}
.toggle-thumb {
  display: block; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; position: absolute; top: 2px; left: 2px;
  transition: left .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.feed-config-toggle.on .toggle-track { background: #534AB7; }
.feed-config-toggle.on .toggle-thumb { left: 18px; }

.nivel-badge {
  display: inline-block; font-size: 0.67rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 1px 7px; border-radius: 10px; margin-bottom: 2px;
}
.nivel-alto  { background: #EAF3DE; color: #27500A; }
.nivel-medio { background: #E6F1FB; color: #0C447C; }
.nivel-bajo  { background: #F1F5F9; color: #334155; }

/* ── Feed: botón eliminar ítem ───────────────────────── */
.activity-item { position: relative; }
.feed-item-delete {
  display: none;
  position: absolute; top: 0.5rem; right: 0;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 2px 4px; border-radius: 4px;
  line-height: 1; font-size: 0.8rem;
  transition: color .15s, background .15s;
}
.activity-item:hover .feed-item-delete { display: block; }
.feed-item-delete:hover { color: #E24B4A; background: #FCEBEB; }

/* ── Notificaciones ─────────────────────────────────── */
.nav-comunicar {
  width: calc(100% - 1rem); margin: 0.25rem 0.5rem 0;
  background: var(--accent); color: white; border: none;
  border-radius: 6px; cursor: pointer; text-align: left;
  padding: 0.5rem 0.75rem; display: flex; align-items: center; gap: 10px;
  font-size: 0.85rem; font-family: inherit;
}
.nav-comunicar:hover { background: #c0303b; }
.notif-badge {
  margin-left: auto; background: var(--accent); color: white;
  font-size: 0.65rem; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; line-height: 1.6;
}
.nav-item .notif-badge { background: var(--accent); }

/* Modal overlay */
.notif-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 500;
}
.notif-modal-box {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  z-index: 501; background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); width: 420px; max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 4rem); overflow-y: auto;
  padding: 1.25rem; box-shadow: var(--shadow-md);
}
.notif-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; font-weight: 600; font-size: 0.95rem;
}
.notif-modal-label {
  font-size: 0.75rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 0.4rem;
}
.notif-accion-preview {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
}
.notif-accion-tiempo { margin-left: auto; font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0; }
.notif-dest-list { display: flex; flex-direction: column; gap: 2px; }
.notif-dest-sep { height: 1px; background: var(--border); margin: 0.4rem 0; }
.notif-dest-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.5rem; border-radius: var(--radius-sm);
  font-size: 0.82rem; cursor: pointer;
}
.notif-dest-item:hover { background: var(--surface-2); }
.notif-dest-todos { font-weight: 500; }

/* Toast */
.notif-toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 600;
  background: #1A1A2E; color: white; border-radius: var(--radius);
  padding: 0.65rem 1rem; font-size: 0.85rem;
  display: flex; align-items: center; gap: 0.5rem;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* Página de notificaciones */
.notif-item {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--border);
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item-nueva { background: #F0F4FF; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-texto { font-size: 0.875rem; line-height: 1.45; word-break: break-word; }
.notif-item-mensaje {
  font-size: 0.82rem; color: var(--text-secondary);
  margin-top: 0.25rem; font-style: italic; word-break: break-word;
}
.notif-item-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; }
.notif-punto {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0; margin-top: 0.4rem;
}
.notif-item-link {
  display: block; text-decoration: none; color: inherit;
  border-radius: 6px; padding: 0.35rem 0.5rem; margin: -0.35rem -0.5rem 0;
  transition: background 0.12s;
}
.notif-item-link:hover { background: var(--surface-2); }
.notif-ir {
  display: inline-flex; align-items: center; gap: 0.2rem;
  font-size: 0.72rem; color: var(--accent); margin-left: 0.5rem; font-weight: 500;
}
.notif-item-actions {
  display: flex; gap: 0.25rem; margin-top: 0.5rem;
}
.notif-action-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 0.2rem 0.5rem;
  border-radius: 4px; font-size: 0.75rem;
  display: flex; align-items: center; gap: 0.25rem;
  transition: color 0.15s, background 0.15s;
}
.notif-action-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.notif-action-delete:hover { color: #dc2626; }
.notif-reply-quote {
  background: var(--surface-2); border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0; padding: 0.55rem 0.8rem; margin-bottom: 1rem;
  font-size: 0.82rem;
}
.taller-comunicar-banner {
  display: flex; align-items: center; gap: 0.6rem;
  background: #EEF6FF; border: 1px solid #BFDBFE;
  border-radius: 6px; padding: 0.5rem 0.75rem;
  font-size: 0.82rem; color: #1D4ED8;
  margin-bottom: 0.75rem;
}
.taller-comunicar-banner span { flex: 1; }
.taller-comunicar-btn {
  background: #2563EB; color: white; border: none; cursor: pointer;
  border-radius: 5px; padding: 0.3rem 0.7rem; font-size: 0.78rem;
  display: flex; align-items: center; gap: 0.3rem;
  white-space: nowrap; transition: background 0.15s;
}
.taller-comunicar-btn:hover { background: #1D4ED8; }
.notif-accion-vacia { color: var(--text-muted); font-style: italic; }
.notif-historial-toggle {
  display: flex; align-items: center; gap: 0.4rem;
  background: none; border: none; cursor: pointer;
  font-size: 0.8rem; color: var(--text-secondary);
  padding: 0.25rem 0; margin-bottom: 0.25rem;
  transition: color 0.15s;
}
.notif-historial-toggle:hover { color: var(--accent); }
.notif-historial-item {
  display: flex; align-items: baseline; justify-content: space-between;
  width: 100%; background: none; border: none; cursor: pointer;
  padding: 0.45rem 0.75rem; border-radius: 6px; text-align: left;
  font-size: 0.82rem; gap: 0.5rem; transition: background 0.1s;
}
.notif-historial-item:hover { background: var(--surface-2); }
.notif-historial-item.activa { background: var(--surface-2); color: var(--accent); font-weight: 500; }
.notif-historial-desc { flex: 1; }
.notif-historial-tiempo { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.notif-reply-de { font-weight: 600; color: var(--text-primary); margin-bottom: 0.15rem; }
.notif-reply-accion { color: var(--text-secondary); }
.notif-reply-msg { color: var(--text-muted); font-style: italic; margin-top: 0.1rem; }
.notif-hilo {
  display: flex; align-items: baseline; gap: 0.4rem;
  font-size: 0.75rem; color: var(--text-muted);
  border-left: 2px solid var(--border); padding-left: 0.6rem;
  margin-bottom: 0.4rem; line-height: 1.35;
}
.notif-hilo-de { font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.notif-hilo-texto { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-enviada-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem; }
.notif-enviada-arrow { color: var(--text-muted); font-size: 0.8rem; }

/* ═══════════════════════════════════════════════════════
   MOBILE — optimización integral para celular
   (375–768px)
═══════════════════════════════════════════════════════ */

/* ── Push notification banner ─────────────────────────── */
#push-banner {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  border-radius: 10px; padding: 0.65rem 1rem;
  font-size: 0.82rem; color: var(--text-primary);
  max-width: calc(100vw - 2rem); z-index: 1000;
  white-space: nowrap;
}
#push-banner span { white-space: normal; }
#push-banner button:first-of-type {
  background: var(--accent); color: #fff; border: none;
  border-radius: 6px; padding: 0.3rem 0.75rem;
  font-size: 0.8rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
#push-banner button:first-of-type:hover { opacity: 0.88; }
.push-banner-close {
  background: none !important; border: none !important; color: var(--text-muted) !important;
  cursor: pointer; font-size: 0.9rem; padding: 0 0.1rem !important;
  line-height: 1; flex-shrink: 0;
}

@media (max-width: 768px) {
  /* ── Main content ── */
  .main-content { padding: 0.75rem; }

  /* ── Topbar ── */
  .topbar-comunicar-txt { display: none; }
  .topbar-comunicar { padding: 0.35rem 0.5rem; border-radius: 6px; }
  .topbar-title {
    overflow: hidden; white-space: nowrap;
    text-overflow: ellipsis; min-width: 0;
    font-size: 0.8rem;
  }
  .topbar-right { flex-shrink: 0; }

  /* ── Formularios → columna única ── */
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }

  /* ── Episode hero ── */
  .episode-hero-header { flex-direction: column; gap: 0.5rem; }
  .episode-status-info { flex-wrap: wrap; }

  /* ── Secciones edición/postpro ── */
  .edicion-row { flex-direction: column; gap: 0; }
  .edicion-campo-fecha { min-width: 0; width: 100%; }

  /* ── Preproducción fechas confirmadas ── */
  .prepro-fecha-confirmed-fields { flex-direction: column; gap: 0.5rem; }
  .prepro-fecha-input-sm { width: 100%; }

  /* ── Checklists ── */
  .check-item-row { flex-wrap: wrap; gap: 0.4rem; }

  /* ── Dashboard cards ── */
  .ep-row-num { min-width: 38px; font-size: 0.68rem; }
  .ep-row-meta { flex-wrap: wrap; gap: 0.2rem; }

  /* ── Cards ── */
  .card { border-radius: 8px; }

  /* ── Notificaciones ── */
  .notif-item-avatar { display: none; }
  .notif-item { padding: 0.75rem; }
}

@media (max-width: 480px) {
  /* ── Main content ── */
  .main-content { padding: 0.5rem; }

  /* ── Topbar: action buttons → icon only ── */
  .topbar-actions .btn { font-size: 0; padding: 0.45rem 0.55rem; min-height: 36px; }
  .topbar-actions .btn i { font-size: 1rem; }
  /* Comunicar accesible desde sidebar en celular */
  .topbar-comunicar { display: none; }

  /* ── Episode detail ── */
  .episode-hero { padding: 0.875rem; }
  .episode-num { font-size: 0.65rem; }
  .episode-tema { font-size: 1.1rem; }
  .episode-tabs-wrap { margin: 0 -0.5rem; padding: 0 0.5rem; }

  /* ── Métricas dashboard ── */
  .metric-card { padding: 0.65rem 0.75rem; }
  .metric-label { font-size: 0.65rem; }
  .metric-value { font-size: 1.25rem; }

  /* ── Feed actividad ── */
  .activity-item { padding: 0.6rem 0.75rem; gap: 0.5rem; }
  .activity-avatar { width: 28px; height: 28px; font-size: 0.75rem; flex-shrink: 0; }

  /* ── Botones táctiles ── */
  .btn { min-height: 36px; }
  .btn-sm { min-height: 32px; }

  /* ── Episodio lista ── */
  .episodes-table td, .episodes-table th { padding: 0.4rem 0.5rem; font-size: 0.8rem; }

  /* ── Notificaciones ── */
  .notif-item-actions { margin-top: 0.35rem; }

  /* ── Kanban ── */
  .kanban-col { padding: 0.75rem; }

  /* ── Invitados ── */
  .seg-row { gap: 0.5rem; }

  /* ── Fecha/hora selects (no desborde horizontal) ── */
  select, input[type="date"], input[type="time"], input[type="text"], textarea {
    max-width: 100%;
  }
}
