/* Menú Comercial — solapa agenda (js/comercial-agenda.js).
   Calendario (Día/Semana/Mes) + panel «Para hacer» + modal de actividad.
   Colores por tipo: reunión azul · llamada verde · tarea ámbar. 48px por hora (COM_AG_PX_HORA). */

.com-ag { display:flex; flex-wrap:wrap; gap:16px; align-items:flex-start; }
.com-ag-cal { flex:999 1 600px; min-width:0; display:flex; flex-direction:column; gap:12px; }
.com-ag-sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* Toolbar */
.com-ag-toolbar { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:10px; }
.com-ag-nav { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.com-ag-nav .com-btn-icono { font-size:18px; }
.com-ag-rango { margin:0 0 0 8px; font-size:17px; font-weight:600; color:#0f172a; }
.com-ag-vistas { display:inline-flex; border:1px solid #cbd5e1; border-radius:8px; overflow:hidden; background:#fff; }
.com-ag-vistas button { height:34px; padding:0 14px; border:0; background:none; font:inherit; font-size:13.5px; color:#64748b; cursor:pointer; }
.com-ag-vistas button + button { border-left:1px solid #cbd5e1; }
.com-ag-vistas button:hover { background:#f1f5f9; }
.com-ag-vistas button.on { background:#eff6ff; color:#1e40af; font-weight:600; }

/* Grilla semana / día */
.com-ag-grid-wrap { background:#fff; border:1px solid #e2e8f0; border-radius:12px; overflow-x:auto; }
.com-ag-grid { min-width:640px; }
.com-ag-grid.dia { min-width:0; }
.com-ag-fila { display:grid; }
.com-ag-fila-head { border-bottom:1px solid #e2e8f0; }
.com-ag-dhead { background:none; border:0; border-left:1px solid #f1f5f9; padding:8px 4px; font:inherit; font-size:12.5px; color:#64748b; cursor:pointer; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.com-ag-dhead b { font-size:15px; color:#0f172a; font-weight:600; }
.com-ag-dhead:hover { background:#f8fafc; }
.com-ag-dhead.hoy b { background:#2563eb; color:#fff; border-radius:999px; padding:1px 7px; }
.com-ag-allday { border-bottom:1px solid #e2e8f0; min-height:30px; }
.com-ag-gutter-txt { font-size:10.5px; color:#94a3b8; padding:6px 4px; text-align:right; line-height:1.2; }
.com-ag-allday-col { border-left:1px solid #f1f5f9; padding:3px; display:flex; flex-direction:column; gap:2px; min-width:0; cursor:pointer; }
.com-ag-gutter { position:relative; }
.com-ag-hora { height:48px; box-sizing:border-box; font-size:11px; color:#94a3b8; text-align:right; padding:0 6px 0 0; transform:translateY(-6px); }
.com-ag-hora:first-child { transform:none; }
.com-ag-col { position:relative; border-left:1px solid #f1f5f9; cursor:pointer; min-width:0; }
.com-ag-col.hoy { background:#f8fbff; }
.com-ag-slot { height:48px; box-sizing:border-box; border-top:1px solid #f1f5f9; }
.com-ag-slot:first-child { border-top:0; }
.com-ag-ahora { position:absolute; left:0; right:0; height:2px; background:#dc2626; pointer-events:none; z-index:2; }
.com-ag-ahora::before { content:''; position:absolute; left:-4px; top:-3px; width:8px; height:8px; border-radius:50%; background:#dc2626; }

/* Eventos (posicionados) y chips (todo el día / mes) */
.com-ag-ev, .com-ag-chip { font:inherit; text-align:left; cursor:pointer; border:0; border-left:3px solid; box-sizing:border-box; overflow:hidden; color:inherit; }
.com-ag-ev { position:absolute; z-index:1; border-radius:6px; padding:3px 6px; font-size:12px; line-height:1.3; display:block; }
.com-ag-ev:hover, .com-ag-chip:hover { filter:brightness(.97); }
.com-ag-ev-h { font-weight:600; }
.com-ag-ev-s { display:block; opacity:.8; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.com-ag-chip { display:block; width:100%; border-radius:4px; padding:1px 5px; font-size:11.5px; line-height:1.45; white-space:nowrap; text-overflow:ellipsis; }
.com-ag-ev.t-reunion, .com-ag-chip.t-reunion { background:#dbeafe; color:#1e3a8a; border-left-color:#2563eb; }
.com-ag-ev.t-llamada, .com-ag-chip.t-llamada { background:#dcfce7; color:#14532d; border-left-color:#16a34a; }
.com-ag-ev.t-tarea, .com-ag-chip.t-tarea { background:#fef3c7; color:#78350f; border-left-color:#d97706; }
.com-ag-ev.hecha, .com-ag-chip.hecha { opacity:.5; text-decoration:line-through; }

/* Vista mes */
.com-ag-mes { display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); background:#fff; border:1px solid #e2e8f0; border-radius:12px; overflow:hidden; }
.com-ag-mhead { font-size:12px; font-weight:600; color:#64748b; padding:8px; border-bottom:1px solid #e2e8f0; text-align:center; }
.com-ag-mcel { min-height:104px; padding:4px; border-left:1px solid #f1f5f9; border-top:1px solid #f1f5f9; display:flex; flex-direction:column; gap:2px; min-width:0; cursor:pointer; }
.com-ag-mcel:nth-child(7n+8) { border-left:0; }
.com-ag-mcel.fuera { background:#f8fafc; }
.com-ag-mcel.fuera .com-ag-mnum { color:#94a3b8; }
.com-ag-mnum { align-self:flex-end; background:none; border:0; font:inherit; font-size:12.5px; color:#334155; cursor:pointer; border-radius:999px; min-width:24px; height:24px; padding:0 6px; }
.com-ag-mnum:hover { background:#f1f5f9; }
.com-ag-mcel.hoy .com-ag-mnum { background:#2563eb; color:#fff; font-weight:600; }
.com-ag-mas { background:none; border:0; font:inherit; font-size:11.5px; color:#2563eb; cursor:pointer; text-align:left; padding:1px 5px; }
.com-ag-mas:hover { text-decoration:underline; }

/* Panel «Para hacer» */
.com-ag-todo { flex:1 1 300px; max-width:360px; overflow:hidden; }
.com-ag-todo-head { display:flex; justify-content:space-between; align-items:baseline; padding:14px 16px 8px; }
.com-ag-todo-head h2 { margin:0; font-size:15px; font-weight:600; color:#0f172a; }
.com-ag-todo-head span { font-size:12.5px; color:#64748b; }
.com-ag-todo-rapida { padding:0 16px 12px; }
.com-ag-todo-rapida .com-input { width:100%; }
.com-ag-todo-gh { font-size:12px; font-weight:600; padding:10px 16px 6px; color:#64748b; background:#f8fafc; border-top:1px solid #e2e8f0; }
.com-ag-todo-gh span { font-weight:500; opacity:.8; }
.com-ag-todo-gh.rojo { color:#991b1b; background:#fef2f2; }
.com-ag-todo-ul { list-style:none; margin:0; padding:0; }
.com-ag-todo-li { display:flex; gap:10px; align-items:flex-start; padding:9px 16px; border-top:1px solid #f1f5f9; }
.com-ag-todo-li input[type="checkbox"] { width:17px; height:17px; margin:2px 0 0; flex-shrink:0; cursor:pointer; accent-color:#2563eb; }
.com-ag-todo-flecha { width:17px; flex-shrink:0; text-align:center; color:#94a3b8; font-size:14px; }
.com-ag-todo-txt { flex:1; min-width:0; background:none; border:0; padding:0; font:inherit; text-align:left; cursor:pointer; color:inherit; }
.com-ag-todo-t { display:block; font-size:13.5px; font-weight:500; color:#0f172a; overflow-wrap:anywhere; }
.com-ag-todo-s { display:block; font-size:12px; color:#64748b; margin-top:2px; }
.com-ag-todo-txt:hover .com-ag-todo-t { color:#2563eb; }
.com-ag-todo-li.atrasada .com-ag-todo-t { color:#991b1b; font-weight:600; }
.com-ag-todo-li.hecha .com-ag-todo-t { color:#94a3b8; text-decoration:line-through; font-weight:400; }
.com-ag-todo-vacio { padding:18px 16px 22px; font-size:13px; color:#64748b; text-align:center; border-top:1px solid #f1f5f9; }

/* Modal de actividad */
.com-ag-w { width:100%; }
.com-ag-seg { display:flex; flex-wrap:wrap; gap:6px; }
.com-ag-seg-b { height:34px; padding:0 12px; border:1px solid #cbd5e1; border-radius:8px; background:#fff; font:inherit; font-size:13.5px; color:#334155; cursor:pointer; }
.com-ag-seg-b:hover { background:#f1f5f9; }
.com-ag-seg-b.on { background:#eff6ff; border-color:#2563eb; color:#1e40af; font-weight:600; }
.com-ag-lugar-lbl { margin-top:10px; }
.com-ag-chips { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:6px; }
.com-ag-chips-vacio { font-size:12.5px; color:#94a3b8; }
.com-ag-pchip { display:inline-flex; align-items:center; gap:5px; padding:3px 4px 3px 10px; border-radius:999px; font-size:12.5px; background:#f1f5f9; color:#334155; }
.com-ag-pchip small { font-size:11px; font-weight:600; opacity:.75; }
.com-ag-pchip.p-usuario { background:#dbeafe; color:#1e40af; }
.com-ag-pchip.p-cliente { background:#dcfce7; color:#166534; }
.com-ag-pchip.p-prospecto { background:#fef3c7; color:#92400e; }
.com-ag-pchip button { border:0; background:none; cursor:pointer; color:inherit; font-size:11px; width:20px; height:20px; border-radius:50%; padding:0; }
.com-ag-pchip button:hover { background:rgba(15,23,42,.08); }
.com-ag-busq { position:relative; }
.com-ag-res { position:absolute; left:0; right:0; top:calc(100% + 4px); z-index:5; background:#fff; border:1px solid #e2e8f0; border-radius:10px; box-shadow:0 10px 30px rgba(15,23,42,.14); max-height:280px; overflow:auto; padding:4px 0; }
.com-ag-res[hidden] { display:none; }
.com-ag-res-g { font-size:10.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:#94a3b8; padding:8px 12px 4px; }
.com-ag-res-o { display:flex; justify-content:space-between; gap:10px; padding:7px 12px; font-size:13.5px; cursor:pointer; }
.com-ag-res-o small { color:#64748b; font-size:12px; white-space:nowrap; }
.com-ag-res-o.sel, .com-ag-res-o:hover { background:#eff6ff; }
.com-ag-res-o.nuevo { color:#2563eb; border-top:1px solid #f1f5f9; margin-top:4px; }
.com-ag-nota summary { font-size:13px; color:#2563eb; cursor:pointer; margin-bottom:8px; }
.com-ag-pie-izq { margin-right:auto; }
.com-ag-confirma { align-self:center; font-size:13.5px; color:#991b1b; font-weight:600; }
.com-ag-btn-borrar { background:#dc2626; border-color:#dc2626; }
.com-ag-btn-borrar:hover { background:#b91c1c; }

@media (max-width: 720px){
  .com-ag-todo { max-width:none; }
  .com-ag-rango { font-size:15px; margin-left:4px; }
  .com-ag-mcel { min-height:72px; }
  .com-ag-chip { font-size:10.5px; }
}
