/* ============================================
   AGENDA - vistas día / semana / mes
   ============================================ */

.agenda-grid {
  display: grid;
  grid-template-columns: 60px repeat(var(--cols, 5), 1fr);
  background: var(--blanco);
  border-radius: var(--radio-md);
  overflow: hidden;
  box-shadow: var(--sombra);
  border: 1px solid var(--borde);
  min-height: 600px;
}

/* Agenda en móvil: columnas con ancho mínimo + scroll horizontal */
@media (max-width: 600px) {
  .agenda-grid {
    grid-template-columns: 50px repeat(var(--cols, 5), minmax(110px, 1fr));
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .agenda-header { font-size: 10px; padding: 8px 4px; }
  .agenda-hora { font-size: 10px; padding: 6px 4px; }
  .cita { font-size: 9px; padding: 3px 4px; }
  .cal-mes { font-size: 11px; }
  .cal-dia { min-height: 60px; padding: 4px; }
  .cal-dia-num { font-size: 11px; }
  .cal-evento { font-size: 8px; padding: 1px 3px; }
}

.agenda-header {
  background: var(--marron);
  color: white;
  padding: 11px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.agenda-hora {
  padding: 8px 6px;
  font-size: 11px;
  color: var(--texto-suave);
  text-align: right;
  border-right: 1px solid var(--borde);
  border-bottom: 1px solid var(--borde);
  background: var(--nude-light);
}

.agenda-cell {
  border-right: 1px solid var(--borde);
  border-bottom: 1px solid var(--borde);
  padding: 2px;
  min-height: 42px;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}

.agenda-cell:hover { background: var(--nude-light); }

.cita {
  background: var(--tierra);
  color: white;
  border-radius: 4px;
  padding: 5px 7px;
  font-size: 10px;
  margin: 1px;
  cursor: pointer;
  line-height: 1.35;
  position: relative;
}

/* Botón de menú de acciones (lápiz) en la esquina superior derecha de cada cita */
.cita-menu-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(255,255,255,0.92);
  color: #4B3C32;
  border: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, transform .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  z-index: 2;
}
.cita:hover .cita-menu-btn { opacity: 1; }
.cita-menu-btn:hover { transform: scale(1.15); background: white; }
/* En móvil siempre visible (no hay hover) */
@media (max-width: 768px) {
  .cita-menu-btn { opacity: 1; }
}

.cita.marron { background: var(--marron); }
.cita.dorado { background: var(--aviso); color: var(--marron); }
.cita.nude   { background: var(--nude); color: var(--marron); }
.cita.exito  { background: var(--exito); }

.cita-hora { font-weight: 700; }
.cita-cliente { opacity: 0.95; }

/* ===== CALENDARIO MENSUAL ===== */
.cal-mes {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--blanco);
  border-radius: var(--radio-md);
  overflow: hidden;
  box-shadow: var(--sombra);
  border: 1px solid var(--borde);
}

.cal-dia-header {
  background: var(--marron);
  color: white;
  padding: 9px;
  text-align: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cal-dia {
  min-height: 95px;
  padding: 7px;
  border-right: 1px solid var(--borde);
  border-bottom: 1px solid var(--borde);
  cursor: pointer;
  transition: background 0.15s;
}

.cal-dia:hover { background: var(--nude-light); }

.cal-dia-num { font-size: 12px; color: var(--texto); font-weight: 600; }

.cal-dia.otro { opacity: 0.35; }

.cal-dia.hoy .cal-dia-num {
  background: var(--marron);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-evento {
  background: var(--tierra);
  color: white;
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 3px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-evento.marron { background: var(--marron); }
.cal-evento.dorado { background: var(--aviso); color: var(--marron); }
.cal-evento.exito  { background: var(--exito); }

/* ===== GRÁFICOS ===== */
.chart-wrap {
  background: white;
  border-radius: var(--radio-md);
  padding: 20px;
  box-shadow: var(--sombra);
  border: 1px solid var(--borde);
  margin-bottom: 20px;
}

.chart-title {
  font-size: 14px;
  color: var(--marron);
  margin-bottom: 14px;
  font-weight: 600;
}

.bars {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  height: 220px;
  padding: 0 6px;
}

.bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.bar {
  width: 100%;
  background: linear-gradient(180deg, var(--tierra) 0%, var(--marron) 100%);
  border-radius: var(--radio-sm) var(--radio-sm) 0 0;
  min-height: 8px;
  position: relative;
  transition: all 0.3s;
  cursor: pointer;
}

.bar:hover { opacity: 0.85; transform: translateY(-2px); }

.bar-val {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--marron);
  font-weight: 600;
  white-space: nowrap;
}

.bar-label {
  font-size: 11px;
  color: var(--texto-suave);
  text-align: center;
}

.line-chart { width: 100%; height: 240px; }

/* =============================================
   AGENDA · Cabeceras sticky + adaptación móvil
   ============================================= */

/* Header de columna (Hora + cada profesional/día) queda fijo al hacer scroll vertical */
.agenda-header {
  position: sticky;
  top: 0;
  z-index: 5;
}

/* Mejorar contraste de los avatares circulares en los headers */
.agenda-header strong { letter-spacing: 0.2px; }

/* === Vista MÓVIL (≤ 600px) === */
@media (max-width: 600px) {
  .agenda-viendo-uno {
    padding: 10px 12px !important;
  }
  .agenda-viendo-uno > div:first-child {
    width: 40px !important; height: 40px !important; font-size: 14px !important;
  }
  .agenda-viendo-uno > div:last-child > div:nth-child(2) {
    font-size: 14px !important;
  }
  .agenda-viendo-varios {
    padding: 8px 10px !important;
  }
  /* Compactar cabeceras de profesional en vista día */
  .agenda-header strong {
    font-size: 11px !important;
    display: block;
    line-height: 1.1;
  }
  .agenda-header span[style*="border-radius:50%"] {
    width: 20px !important; height: 20px !important; font-size: 9px !important;
  }
  /* Citas más compactas */
  .cita { font-size: 9px !important; padding: 2px 4px !important; }
  .cita-hora { font-weight: 600; }
  /* Más espacio entre filas para tocar fácil */
  .agenda-cell { min-height: 36px; }
}

/* === Tablet (601-900px) === */
@media (min-width: 601px) and (max-width: 900px) {
  .agenda-header strong { font-size: 12px; }
  .cita { font-size: 10px; }
}
