/* Rocket Solutions admin upgrades — v1.9.7 */

/* ===== 1) GRID estable: 1 columna de técnicos + 5 días ===== */
.acal-grid{
  display: grid;
  grid-template-columns: 220px repeat(5, minmax(240px, 1fr));
  grid-auto-rows: minmax(84px, auto);
  max-width: 100%;
  overflow: auto;
}

/* ===== 2) Celdas y encabezados ===== */
.acal-cell{
  padding: 8px;
  border-right: 1px solid #eef1f5;
  border-bottom: 1px solid #eef1f5;
  position: relative; /* para posicionar +Agregar */
}
.acal-head{ background:#f9fafb; }

/* ===== 3) Sticky encabezado y 1ª columna ===== */
.acal-grid .acal-head{ position: sticky; top: 0; z-index: 5; }
.acal-grid .acal-tech-col{
  position: sticky; left: 0; z-index: 6;
  background:#f5f7fa;
  box-shadow: inset -1px 0 0 #eef1f5; /* separador vertical */
}
.acal-grid .acal-head.acal-tech-col{ z-index: 7; }

/* ===== 4) 1ª columna: el bloque del técnico no invade la columna del lunes ===== */
.acal-grid .acal-tech-col.acal-cell{
  padding: 0 !important;
  background: transparent; /* el fondo lo maneja el bloque interno */
}

.acal-grid .acal-tech-col .acal-techname{
  display: flex;
  align-items: center;
  justify-content: center;

  /* Márgenes mantienen separación con el borde de la celda sticky */
  margin: 8px 12px;            /* <-- evita que cruce a la columna de lunes */
  padding: 12px 16px;

  /* Tamaño automático (sin 100%): respeta márgenes y no desborda */
  width: auto;
  height: auto;
  min-height: 52px;

  border-radius: 16px;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;

  box-shadow: 0 4px 10px rgba(0,0,0,.06), inset 0 -1px 0 rgba(255,255,255,.15);
  position: relative;
  overflow: hidden;
}

/* Brillo sutil para dar profundidad sin perder el color del técnico */
.acal-grid .acal-tech-col .acal-techname::after{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,.10), rgba(255,255,255,0) 45%),
              linear-gradient(to top, rgba(0,0,0,.04), rgba(0,0,0,0) 60%);
  pointer-events: none;
}

/* ===== 5) “+ Agregar” solo al pasar el cursor ===== */
.acal-grid .acal-cell .acal-add{
  position: absolute; top: 6px; right: 6px; z-index: 2;
  opacity: 0; pointer-events: none; transition: opacity .12s ease-in-out;
}
.acal-grid .acal-cell:hover .acal-add{ opacity: 1; pointer-events: auto; }

/* ===== 6) Tarjetas más legibles ===== */
.acal-task{
  position: relative; z-index: 1;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  background:#fff;
}
.acal-task .acal-task-title{ font-weight: 700; }
.acal-task .acal-task-meta{ color:#6b7280; font-size:12px; }
.acal-task .badge{ font-size:11px; }

/* ===== 7) Ocultar leyenda arriba y “Estado” en UI ===== */
.acal-legend{ display: none !important; }
#acal-estado{ display: none !important; }
label:has(#acal-estado){ display:none !important; } /* si el navegador lo soporta */

/* ===== 8) Filtros compactos y responsivos ===== */
.acal-topbar .acal-filters{ display:flex; flex-wrap:wrap; gap:8px; }
.acal-topbar .acal-filters label{ white-space:nowrap; }
.acal-topbar input[type="search"]{ min-width:260px; }

/* ===== 9) Botones en header sin quiebre ===== */
.acal-export.button, .acal-head .button { white-space: nowrap; }

/* Ocultar estado/badges en tarjetas (admin y frontend) */
.acal-wrap .acal-task .acal-task-badges,
.acal-wrap .acal-task .badge{
  display: none !important;
}

/* Ocultar "+ Agregar" específicamente en frontend */
.acal-frontend .acal-add{ display:none !important; }

/* Delinea celdas aunque tengan fondo suave */
.acal-grid .acal-cell{
  border-right: 1px solid rgba(238,241,245,.9);
  border-bottom: 1px solid rgba(238,241,245,.9);
}

/* AM/PM pill en tarjetas */
.acal-turno{
  display:inline-block; margin-right:4px; padding:2px 6px;
  border-radius:999px; font-size:11px; line-height:1.1;
  border:1px solid currentColor; opacity:.85;
}
.acal-turno.am{ color:#0d9488; background:rgba(13,148,136,.08); border-color:rgba(13,148,136,.25); }
.acal-turno.pm{ color:#7c3aed; background:rgba(124,58,237,.08); border-color:rgba(124,58,237,.25); }

/* DnD visual (admin) */
.acal-task{ cursor: grab; }
.acal-task.is-dragging{ opacity:.6; cursor: grabbing; }
.acal-cell.drop-ok{
  outline: 2px dashed #3b82f6;
  outline-offset: -2px;
  background: rgba(59,130,246,.06);
}


/* Pastilla del técnico con flechas adentro */
.acal-techname{
  display:flex;
  align-items:center;
  justify-content:space-between;      /* nombre al centro, flechas a los costados */
  gap:8px;
  border-radius:16px;
  padding:12px 10px;
}

.acal-techlabel{
  flex:1 1 auto;
  text-align:center;
  font-weight:700;
  letter-spacing:.3px;
}

.acal-order-btn{
  flex:0 0 auto;
  width:28px; height:28px;
  line-height:26px;
  border:0;
  border-radius:8px;
  background: rgba(255,255,255,.22);  /* contraste sobre el color del técnico */
  color: inherit;                     /* usa el color de texto calculado */
  cursor:pointer;
}
.acal-order-btn:hover{ background: rgba(255,255,255,.30); }
.acal-order-btn:disabled{ opacity:.45; cursor:not-allowed; }

/* limpia el estilo anterior de controles externos si quedó */
.acal-order-controls{ display:none !important; }

/* Acciones fijas arriba-izquierda en cada celda */
.acal-actions-fixed{
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

/* Asegura anclaje y espacio para los botones */
.acal-grid .acal-cell{
  position: relative;      /* para posicionar .acal-actions-fixed */
  padding-top: 38px;       /* deja espacio bajo los botones */
}

/* Botones con tamaño consistente */
.acal-actions-fixed .button{
  line-height: 1.2;
  height: auto;
  padding: 4px 8px;
}

/* Contenedor fijo para "Pegar" (sin tocar el "+ Agregar" del plugin) */
.acal-actions-fixed{
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  gap: 8px;
  z-index: 3;
}

/* Asegura anclaje y espacio en cada celda */
.acal-grid .acal-cell{
  position: relative;
  padding-top: 38px; /* deja espacio bajo los botones */
}

/* Forzar "+ Agregar" a la izquierda cuando el plugin lo posiciona */
.button.acal-add{
  left: 6px !important;
  right: auto !important;
  top: 6px !important;
  transform: none !important;
  z-index: 4; /* por encima de tarjetas */
}

/* Estética de botones */
.acal-actions-fixed .button{
  line-height: 1.2;
  height: auto;
  padding: 4px 8px;
}

/* Oculta + Agregar mientras estás en modo copiar */
body.acal-copy-mode .button.acal-add {
  display: none !important;
}

/* Aviso flotante para salir del modo copiar (opcional) */
.acal-copy-pill{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  background: #1d4ed8;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
  font-size: 12px;
}
.acal-copy-pill button{
  margin-left: 8px;
  background: #fff;
  color: #1d4ed8;
  border: 0;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}

/* Por defecto, ocultar "Pegar" */
.acal-paste { display: none !important; }

/* En modo copiar, mostrar "Pegar" */
body.acal-copy-mode .acal-paste { display: inline-flex !important; }
