/* ═══════════════════════════════════════
   centro.css — Estilos del dashboard Centro de Mando Platino
   Extraído de assets/index.html (split 2026-08-27)
   ═══════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Playfair+Display:wght@500;600;700;800&display=swap');
/* ── Tema elegante · Platino Studio (claro: crema + oliva + arena) ── */
:root {
  --bg: #f6f5f1; --surface: #ffffff; --surface2: #f3f0e9;
  --border: #e6e0d3; --text: #2f3b2c; --text2: #857d6c;
  --gold: #4a5d45; --gold2: #c9b98a; --arena: #a89a80;
  --green: #4d7c0f; --blue: #5b7c99; --red: #c0563f;
  --purple: #8b6b4f; --pink: #c4746b;
  --shadow: 0 12px 36px rgba(47,59,44,0.07);
  --shadow-lg: 0 28px 80px rgba(47,59,44,0.18);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: 'Playfair Display', Georgia, serif; letter-spacing: 0.01em; }

/* ─── AUTH SCREEN ─── */
#authScreen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 2rem;
}
.auth-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 3rem; max-width: 400px; width: 100%;
  text-align: center;
}
.auth-box h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.auth-box h1 span { color: var(--gold); }
.auth-box .sub { color: var(--text2); margin-bottom: 2rem; font-size: 0.9rem; }
.auth-box input {
  width: 100%; padding: 0.8rem 1rem; margin-bottom: 1rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 1rem; text-align: center;
}
.auth-box .btn {
  width: 100%; padding: 0.8rem; border: none; border-radius: 8px;
  background: var(--gold); color: #fff; font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: all 0.15s;
}
.auth-box .btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.auth-box .error { color: var(--red); font-size: 0.85rem; margin-top: 0.5rem; display: none; }

/* ─── MAIN DASHBOARD ─── */
#dashboard { display: none; padding: 1.5rem; }

.header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 1rem;
}
.header-left { display: flex; align-items: center; gap: 1rem; }
.header-left h1 { font-size: 1.3rem; }
.header-left h1 span { color: var(--gold); }
.project-selector {
  display: flex; align-items: center; gap: 0.5rem;
}
.project-selector select {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 0.5rem 2rem 0.5rem 0.8rem;
  font-size: 0.9rem; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.5rem center;
  min-width: 180px;
}
.header-right { display: flex; align-items: center; gap: 0.75rem; }
.header-right .btn-logout {
  background: none; border: 1px solid var(--border); color: var(--text2);
  padding: 0.4rem 0.8rem; border-radius: 6px; cursor: pointer; font-size: 0.75rem;
}
.header-right .btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ─── STATS BAR ─── */
.stats-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.8rem; text-align: center;
}
.stat-card .num { font-size: 1.5rem; font-weight: 700; }
.stat-card .label { font-size: 0.7rem; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; }

/* ─── TABS ─── */
.tabs {
  display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.tab {
  padding: 0.6rem 1.2rem; border: none; background: none;
  color: var(--text2); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.15s; white-space: nowrap;
  display: flex; align-items: center; gap: 0.4rem;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab .badge {
  background: var(--surface2); padding: 0.1rem 0.4rem; border-radius: 10px;
  font-size: 0.65rem; color: var(--text2);
}

/* ─── LAYOUT CRM: sidebar + contenido ─── */
#dashboard { padding-left: 262px; }
.sidebar {
  position: fixed; left: 1.25rem; top: 1.25rem; bottom: 1.25rem; width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 1rem 0.75rem; overflow-y: auto; box-shadow: var(--shadow); z-index: 50;
}
.sidebar .nav-grupo {
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text2); margin: 0.9rem 0.55rem 0.25rem;
}
.sidebar .nav-item {
  display: flex; align-items: center; gap: 0.55rem; width: 100%;
  padding: 0.5rem 0.65rem; margin: 0.1rem 0; border: none; background: none;
  color: var(--text2); font-size: 0.84rem; font-weight: 600; text-align: left;
  border-radius: 10px; cursor: pointer; transition: all 0.12s;
}
.sidebar .nav-item:hover { background: var(--surface2); color: var(--text); }
.sidebar .nav-item.active { background: var(--gold); color: #fff; box-shadow: 0 6px 16px rgba(74,93,69,0.25); }
.sidebar .nav-item .badge { margin-left: auto; background: var(--surface2); padding: 0.08rem 0.45rem; border-radius: 10px; font-size: 0.65rem; color: var(--text2); }
.sidebar .nav-item.active .badge { background: rgba(255,255,255,0.28); color: #fff; }
.sidebar .nav-item .nav-ico { width: 20px; text-align: center; font-size: 0.95rem; flex-shrink: 0; }
.area-notif-box { margin-top: 1rem; }
@media (max-width: 900px) {
  #dashboard { padding-left: 1.5rem; }
  .sidebar { position: static; width: 100%; border-radius: 14px; margin-bottom: 1rem; max-height: none; }
  .sidebar .nav-grupo, .sidebar .nav-item { display: inline-flex; width: auto; }
  .sidebar .nav-grupo { margin: 0.3rem 0.5rem 0.2rem; }
}

/* ─── TAB PANELS ─── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-layout {
  display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem;
}
@media (max-width: 900px) { .panel-layout { grid-template-columns: 1fr; } }

/* ─── CARDS ─── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem; margin-bottom: 1rem;
}
.card h3 { font-size: 0.9rem; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.4rem; }

/* ─── TASKS ─── */
.task-input-row {
  display: flex; gap: 0.5rem; margin-bottom: 1rem;
}
.task-input-row input, .task-input-row select {
  padding: 0.5rem 0.8rem; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 0.85rem;
}
.task-input-row input { flex: 1; }
.btn-sm {
  padding: 0.5rem 1rem; border: none; border-radius: 6px;
  background: var(--gold); color: #fff; font-weight: 600; font-size: 0.8rem;
  cursor: pointer; white-space: nowrap;
}
.btn-sm:hover { filter: brightness(1.1); }

.task-list { display: flex; flex-direction: column; gap: 0.4rem; }
.task-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.8rem; background: var(--surface2); border-radius: 8px;
  border-left: 3px solid var(--text2); font-size: 0.85rem;
  transition: all 0.15s;
}
.task-item:hover { transform: translateX(3px); }
.task-item .check {
  width: 18px; height: 18px; border: 2px solid var(--text2); border-radius: 50%;
  cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; transition: all 0.15s;
}
.task-item .check:hover { border-color: var(--green); }
.task-item.done { opacity: 0.5; }
.task-item.done .check { background: var(--green); border-color: var(--green); }
.task-item.done .check::after { content: "✓"; color: #fff; font-weight: 700; }
.task-item .task-title { flex: 1; }
.task-item .task-meta { font-size: 0.7rem; color: var(--text2); }
.task-item .task-priority {
  font-size: 0.65rem; padding: 0.1rem 0.4rem; border-radius: 4px; font-weight: 600;
}
.prio-critica { background: rgba(220,38,38,0.12); color: var(--red); }
.prio-alta { background: rgba(220,38,38,0.08); color: var(--red); }
.prio-media { background: rgba(124,58,237,0.10); color: var(--gold); }
.prio-baja { background: rgba(131,125,111,0.08); color: var(--text2); }

/* ─── CAMPAIGNS ─── */
.campana-item {
  padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem;
  display: flex; justify-content: space-between; align-items: center;
}
.campana-item:last-child { border-bottom: none; }
.campana-item .name { font-weight: 600; }
.campana-item .meta { font-size: 0.7rem; color: var(--text2); }
.status-badge {
  font-size: 0.65rem; padding: 0.15rem 0.5rem; border-radius: 10px; font-weight: 600;
}
.status-borrador { background: rgba(131,125,111,0.12); color: var(--text2); }
.status-programada { background: rgba(37,99,235,0.12); color: var(--blue); }
.status-enviada { background: rgba(22,163,74,0.12); color: var(--green); }

/* ─── BOOKS ─── */
.book-item {
  padding: 0.6rem; background: var(--surface2); border-radius: 8px; margin-bottom: 0.5rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.book-item .info { flex: 1; }
.book-item .title { font-weight: 600; font-size: 0.85rem; }
.book-item .sub { font-size: 0.75rem; color: var(--text2); }
.progress-bar {
  height: 4px; background: var(--border); border-radius: 2px; margin-top: 0.3rem;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%; border-radius: 2px; background: var(--gold); transition: width 0.3s;
}

/* ── Refinamientos elegantes ── */
.auth-box { border-radius: 22px; box-shadow: var(--shadow-lg); border-color: transparent; }
.auth-box h1 span, .header-left h1 span { color: var(--gold2); }
.card { border-radius: 16px; box-shadow: var(--shadow); }
.stat-card { border-radius: 12px; box-shadow: var(--shadow); }
.btn-sm { border-radius: 8px; box-shadow: 0 4px 12px rgba(74,93,69,0.18); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold2); border-bottom-width: 3px; }
.progress-bar .fill { background: var(--gold2); }

/* ── BUZÓN (correos) — tabla ordenada ── */
.buzon-toolbar { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.75rem; }
.buzon-toolbar input[type="text"], .buzon-toolbar select {
  padding: 0.45rem 0.7rem; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 0.82rem; outline: none;
}
.buzon-toolbar input[type="text"] { flex: 1; min-width: 200px; }
.buzon-toolbar input::placeholder { color: var(--text2); }
.buzon-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.buzon-tabla { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 0.82rem; min-width: 560px; }
.buzon-tabla th {
  background: var(--surface2); color: var(--text2); text-align: left;
  padding: 0.6rem 0.8rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.buzon-tabla td {
  padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border);
  vertical-align: middle; overflow-wrap: anywhere; word-break: break-word;
  color: var(--text);
}
.buzon-tabla tr:last-child td { border-bottom: none; }
.buzon-fila { cursor: pointer; transition: background 0.12s; }
.buzon-fila:hover { background: var(--surface2); }
.buzon-fecha { width: 105px; white-space: nowrap; color: var(--text2); font-size: 0.75rem; }
.buzon-rem { width: 24%; color: var(--text2); }
.buzon-dest { width: 24%; color: var(--gold); font-weight: 600; }
.buzon-asunto { font-weight: 500; }
/* chip de código en el modal */
.codigo-box { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.6rem; flex-wrap: wrap; }
.codigo-chip {
  background: var(--gold); color: #fff; font-weight: 800; font-size: 1.05rem;
  letter-spacing: 0.12em; padding: 0.35rem 0.9rem; border-radius: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
/* ── NOTIFICACIONES — chips de filtro por categoría ── */
.notif-chip {
  padding: 0.35rem 0.7rem; border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); color: var(--text2); font-size: 0.75rem; font-weight: 600;
  cursor: pointer; transition: all 0.12s; white-space: nowrap;
}
.notif-chip:hover { border-color: var(--gold); color: var(--text); }
.notif-chip.active { background: var(--gold); border-color: var(--gold); color: #fff; }

/* ── MODAL CORREO ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(47,59,44,0.45);
  align-items: center; justify-content: center; z-index: 2000; padding: 1.5rem;
}
.modal-overlay.show { display: flex; }
.modal-card {
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  max-width: 720px; width: 100%; max-height: 86vh; overflow: hidden; display: flex; flex-direction: column;
}
.modal-head { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 1.1rem; }
.modal-head .meta { font-size: 0.75rem; color: var(--text2); margin-top: 0.3rem; }
.modal-body { padding: 1.2rem 1.5rem; overflow-y: auto; font-size: 0.85rem; white-space: pre-wrap; line-height: 1.6; color: var(--text); flex: 1; }
.modal-foot { padding: 0.9rem 1.5rem; border-top: 1px solid var(--border); text-align: right; }

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: 2rem; right: 2rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem 1.5rem;
  box-shadow: 0 20px 60px rgba(44,42,37,0.18);
  display: none; z-index: 1000; animation: slideUp 0.3s ease;
  max-width: 400px;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.toast.show { display: block; }
.toast .title { font-weight: 600; margin-bottom: 0.3rem; }
.toast .msg { font-size: 0.85rem; color: var(--text2); }

.loading { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(44,42,37,0.15); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Calendar from original dashboard */
.calendar { background: var(--surface); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.cal-header { display: grid; grid-template-columns: repeat(6, 1fr); background: var(--surface2); border-bottom: 1px solid var(--border); }
.cal-header div { padding: 0.75rem 0.5rem; text-align: center; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; color: var(--text2); letter-spacing: 0.05em; }
.cal-body { display: grid; grid-template-columns: repeat(6, 1fr); }
.day-card { min-height: 180px; padding: 0.75rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); position: relative; }
.day-card:nth-child(6n) { border-right: none; }
.day-card .day-name { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; }
.day-card .day-num { font-size: 1.8rem; font-weight: 200; color: var(--text2); position: absolute; top: 0.5rem; right: 0.75rem; }
.day-card .rest { display: flex; align-items: center; justify-content: center; height: 100px; color: var(--text2); font-size: 0.85rem; font-style: italic; }
.slot { background: var(--surface2); border-radius: 6px; padding: 0.5rem; margin-bottom: 0.4rem; font-size: 0.75rem; border-left: 3px solid var(--blue); cursor: pointer; transition: all 0.15s; }
.slot:hover { transform: translateX(3px); }
.slot .time { color: var(--text2); font-size: 0.65rem; }
.slot .cuenta { font-weight: 600; }
.slot .tema { color: var(--text2); font-size: 0.7rem; }

.mega-browser { max-height: 200px; overflow-y: auto; }
.mega-browser .file { display: flex; justify-content: space-between; align-items: center; padding: 0.3rem 0; font-size: 0.75rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.mega-browser .file:hover { color: var(--gold); }

.bitacora .entry { padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.8rem; display: flex; align-items: center; gap: 0.5rem; }
.bitacora .entry:last-child { border-bottom: none; }
.bitacora .entry .badge { display: inline-block; padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; }
.badge-video { background: rgba(37,99,235,0.12); color: var(--blue); }
.badge-mailing { background: rgba(147,51,234,0.12); color: var(--purple); }
.badge-tarea { background: rgba(22,163,74,0.12); color: var(--green); }
.badge-cliente { background: rgba(124,58,237,0.12); color: var(--gold); }

/* ── Aviso del panel de trabajadores (pestaña VIDEOS) ──
   Es la puerta al panel privado /videos-trabajo. Su color sale de tokens, no de
   un style="" en línea: el atributo gana sobre la hoja y desarma el tema. */
.aviso-trabajadores { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: 8px; }
.aviso-trabajadores .t { font-size: 0.85rem; color: var(--text2); }
.aviso-trabajadores .t strong { color: var(--text); }
.aviso-trabajadores a { text-decoration: none; background: var(--gold); color: #fff; font-size: 0.82rem; font-weight: 700; padding: 0.5rem 1rem; border-radius: 9px; white-space: nowrap; }
.aviso-trabajadores a:hover { filter: brightness(1.08); }
